Retrieves the details of historical events.
Operation description
Do not call this operation frequently. To retrieve events in near-real time, you can create a trail to deliver events to Simple Log Service (SLS) and use its real-time consumption feature. For more information, see Create a single-account trail, Create a multi-account trail, and Real-time consumption.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
actiontrail:LookupEvents |
get |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| NextToken |
string |
No |
The token that is used to request the next page of results. Note
The request parameters must be the same as those of the previous request. |
eyJhY2NvdW50IjoiMTQyNDM3OTU4NjM4NzE2MSIsImV2ZW50SWQiOiI3MkJDRTExRi02OTU3LTQ0NUItQjY0MC1CNEUyMkM4NUEwQzgiLCJsb2dJZCI6IjgyLTE0MjQzNzk1ODYzODcxNjEiLCJ0aW1lIjoxNjAyMzExNTQwMD**** |
| MaxResults |
string |
No |
The maximum number of results to return. |
20 |
| StartTime |
string |
No |
The beginning of the time range to query events. The time is in the ISO 8601 format and is in UTC. The format is Note
You must specify both StartTime and EndTime, or leave both unspecified. If you leave them unspecified, the default value of StartTime is 7 days before the current time. |
2020-10-08T11:00:00Z |
| EndTime |
string |
No |
The end of the time range to query events. The time is in the ISO 8601 format and is in UTC. The format is Note
You must specify both StartTime and EndTime, or leave both unspecified. If you leave them unspecified, the default value of EndTime is the current time. |
2020-10-15T11:00:00Z |
| Direction |
string |
No |
The order in which events are retrieved. Valid values:
|
BACKWARD |
| LookupAttribute |
array<object> |
No |
The lookup conditions. Note
You can specify one or two lookup conditions at a time. For more information, see Limits. |
|
|
object |
No |
|||
| Key |
string |
No |
The key of the lookup condition. For information about valid values, see Set the LookupAttribute parameter. |
ServiceName |
| Value |
string |
No |
The value of the lookup condition. For information about valid values, see Set the LookupAttribute parameter. |
Ecs |
For information about common request parameters, see Common parameters.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| EndTime |
string |
The end of the time range of the retrieved events. |
2020-07-22T14:00:00Z |
| Events |
array<object> |
A list of retrieved events. |
|
|
object |
A list of retrieved events. For more information about the event fields in the list, see Structure of a management event. |
{ "eventId": "6EEC3A76-C207-5075-889D-A909E62F****", "eventVersion": 1, "eventName": "GetTemplate" } |
|
| NextToken |
string |
The token that is used to retrieve the next page of results. Note
This parameter is not returned if no more results are available. |
eyJhY2NvdW50IjoiMTQyNDM3OTU4NjM4NzE2MSIsImV2ZW50SWQiOiI3MkJDRTExRi02OTU3LTQ0NUItQjY0MC1CNEUyMkM4NUEwQzgiLCJsb2dJZCI6IjgyLTE0MjQzNzk1ODYzODcxNjEiLCJ0aW1lIjoxNjAyMzExNTQwMD**** |
| RequestId |
string |
The ID of the request. |
FD79665A-CE8B-49D4-82E6-5EE2E0E7**** |
| StartTime |
string |
The start of the time range of the retrieved events. |
2020-07-15T14:00:00Z |
Examples
Success response
JSON format
{
"EndTime": "2020-07-22T14:00:00Z",
"Events": [
{
"eventId": "6EEC3A76-C207-5075-889D-A909E62F****",
"eventVersion": 1,
"eventName": "GetTemplate"
}
],
"NextToken": "eyJhY2NvdW50IjoiMTQyNDM3OTU4NjM4NzE2MSIsImV2ZW50SWQiOiI3MkJDRTExRi02OTU3LTQ0NUItQjY0MC1CNEUyMkM4NUEwQzgiLCJsb2dJZCI6IjgyLTE0MjQzNzk1ODYzODcxNjEiLCJ0aW1lIjoxNjAyMzExNTQwMD****",
"RequestId": "FD79665A-CE8B-49D4-82E6-5EE2E0E7****",
"StartTime": "2020-07-15T14:00:00Z"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | IncompleteSignature | The request signature does not conform to Alibaba Cloud standards. | The request signature does not conform to Alibaba Cloud standards. |
| 400 | InvalidParameterCombination | The end time must be later than the start time. | The end time must be greater than the start time. |
| 400 | InvalidQueryParameter | The specified query parameter is invalid. | The specified query parameter is not valid. |
| 400 | InvalidParameterEndTime | The specified EndTime is invalid. | |
| 400 | InvalidParameterStartTime | The specified StartTime is invalid. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.