Queries the number of alert logs that are generated during each interval within a period of time.
Operation description
This topic provides an example on how to query the number of alert logs for Elastic Compute Service (ECS) based on the product dimension.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
cms:DescribeAlertLogHistogram |
get |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| StartTime |
integer |
No |
The start timestamp of the alert logs to be queried. Unit: milliseconds. Note
|
1609988009694 |
| EndTime |
integer |
No |
The end timestamp of the alert logs to be queried. Unit: milliseconds. Note
|
1609989009694 |
| 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 keyword that is used to query alert logs. |
alert |
| GroupId |
string |
No |
The ID of the application group. |
7301**** |
| Product |
string |
No |
The abbreviation of the Alibaba Cloud service name. |
ECS |
| Namespace |
string |
No |
The namespace of the Alibaba Cloud service. Note
For more information about the namespaces of different cloud services, see Appendix 1: Metrics. |
acs_ecs_dashboard |
| Level |
string |
No |
The severity level and notification methods of the alert. Valid values:
|
P4 |
| SendStatus |
string |
No |
The alert status. Valid values:
If 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 contact group. |
ECS_Group |
| RuleName |
string |
No |
The name of the alert rule. |
test123 |
| MetricName |
string |
No |
The metric name. 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 |
No |
The dimensions based on which data is aggregated. This parameter is equivalent to the GROUP BY clause in SQL. Valid values:
|
product |
| SourceType |
string |
No |
This parameter is deprecated. |
无 |
| EventType |
string |
No |
The type of the alert event. Valid values:
|
RESOLVED |
| RuleId |
string |
No |
The ID of the alert rule. For more information about how to obtain the ID of an alert rule, see DescribeMetricRuleList. |
ae06917_75a8c43178ab66**** |
For more information about common request parameters, see Common parameters.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
None. |
||
| Code |
string |
The response code. Note
The status code 200 indicates that the request was successful. |
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 request was successful. Valid values:
|
true |
| AlertLogHistogramList |
array<object> |
The number of alert logs that were generated during each interval of a time period. |
|
|
object |
|||
| From |
integer |
The start timestamp of the queried alert logs. Unit: seconds. |
1610074791 |
| To |
integer |
The end timestamp of the queried alert logs. Unit: seconds. |
1610074800 |
| Count |
integer |
The number of alert logs. |
20 |
Examples
Success response
JSON format
{
"Code": "200",
"Message": "The specified resource is not found.",
"RequestId": "1C4A3709-BF52-42EE-87B5-7435F0929585",
"Success": true,
"AlertLogHistogramList": [
{
"From": 1610074791,
"To": 1610074800,
"Count": 20
}
]
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | ParameterInvalid | %s | |
| 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.