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.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
cms:DescribeAlertLogHistogram | get |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
StartTime | long | No | The start timestamp of the alert logs to be queried. Unit: milliseconds. Note
| 1609988009694 |
EndTime | long | 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. | None |
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 parameters
Examples
Sample success responses
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 | - |
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 | View Change Details |
2023-07-27 | The Error code has changed. The request parameters of the API has changed | View Change Details |