Queries the histogram list of alert history by calling the DescribeAlertLogHistogram operation.
Operation description
This topic provides an example of how to query the histogram list of ECS alert history from the Alibaba Cloud service 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 for querying alert history. Unit: milliseconds. Note
|
1609988009694 |
| EndTime |
integer |
No |
The end timestamp for querying alert history. 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 for searching alert history. |
alert |
| GroupId |
string |
No |
The application group ID. |
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 information about the namespaces of Alibaba Cloud services, see Metrics. |
acs_ecs_dashboard |
| 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 P4, an alert is triggered. If the value of Level is OK, the alert recovers to Normal. |
0 |
| ContactGroup |
string |
No |
The alert contact group. |
ECS_Group |
| RuleName |
string |
No |
The alert rule name. |
test123 |
| MetricName |
string |
No |
The metric name. Note
For information about the metrics of Alibaba Cloud services, see Metrics. |
cpu_total |
| LastMin |
string |
No |
The period for obtaining logs. Unit: minutes. |
360 |
| GroupBy |
string |
No |
Aggregates data by spatial dimension, equivalent to Group By in SQL. Valid values:
|
product |
SourceType
deprecated
|
string |
No |
[Deprecated] This parameter is deprecated and does not need to be specified. |
None |
| EventType |
string |
No |
The alert type. Valid values:
|
RESOLVED |
| RuleId |
string |
No |
The alert rule ID. For information about how to obtain the alert rule ID, see DescribeMetricRuleList. |
ae06917_75a8c43178ab66**** |
For more information about common request parameters, see Common parameters.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
None. |
||
| AlertLogHistogramList |
array<object> |
The histogram list of alert history. |
|
|
object |
None. |
||
| Count |
integer |
The number of alert history entries. |
20 |
| From |
integer |
The start timestamp for querying alert history. Unit: seconds. |
1610074791 |
| To |
integer |
The end timestamp for querying alert history. Unit: seconds. |
1610074800 |
| Code |
string |
The status code. Note
The value 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 was successful. Valid values:
|
true |
Examples
Success response
JSON format
{
"AlertLogHistogramList": [
{
"Count": 20,
"From": 1610074791,
"To": 1610074800
}
],
"Code": "200",
"Message": "The specified resource is not found.",
"RequestId": "1C4A3709-BF52-42EE-87B5-7435F0929585",
"Success": true
}
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.