You can call this operation to query events.

When you call this operation to query historical events for a single-account trail, you can query the events two times per second at most.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes LookupEvents

The operation that you want to perform. Set the value to LookupEvents.

Event String No AD9CD9DA-EC2D-4EB7-A817-C0442A94****

The ID of the event.

Request String No AD9CD9DA-EC2D-4EB7-A817-C0442A94****

The ID of the request

EventType String No ConsoleSignin

The type of the event. Valid values:

  • ApiCall: specifies an API call.
  • ConsoleOperation: specifies an operation in the Alibaba Cloud Management Console.
  • AliyunServiceEvent: specifies an operation that is automatically performed by an Alibaba Cloud service.
  • PasswordReset: specifies a password reset.
  • ConsoleSignin: specifies a logon to the Alibaba Cloud Management Console.
  • ConsoleSignout: specifies a logoff to the Alibaba Cloud Management Console.
ServiceName String No AsaSub

The name of the cloud service.

EventName String No ConsoleSignin

The name of the event.

User String No yanjie.wyj

The name of the RAM user who calls the operation.

ResourceType String No Instance

The type of the resource.

ResourceName String No i-bp14664y88udkt45****

The name of the resource.

EventRW String No Write

The read/write type of the event. Valid values:

  • Read: a read event.
  • Write: a write event. It is the default value.
  • All: read and write events.
EventAccessKeyId String No LTAI4FoDkCf4DU1bic1V****

The AcessKey ID used in the event.

NextToken String No 20

The token for requesting the next page of query results.

Note The request parameters must be the same as those of the last request.
MaxResults String No 20

The maximum number of entries to be returned.

Valid values: 0 to 50.

StartTime String No 2020-06-15T14:00:00Z

The beginning of the time range to query. The default time is seven days prior to the current time. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

Note The maximum time range is 30 days. You can query events in the recent 90 days.
EndTime String No 2020-06-22T14:00:00Z

The end of the time range to query. The default time is the current time. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

Note The maximum time range is 30 days. You can query events in the recent 90 days.

For more information about the fields in an event log, see ActionTrail event log reference.

Response parameters

Parameter Type Example Description
Events List AD9CD9DA-EC2D-4EB7-A817-C0442A94****

The returned event.

NextToken String 1

The token for returning the next page of query results.

Note This parameter is not returned if no more results are to be returned.
StartTime String 2020-07-15T14:00:00Z

The beginning of the time range when events were queried.

EndTime String 2020-07-22T14:00:00Z

The end of the time range when events were queried.

RequestId String FD79665A-CE8B-49D4-82E6-5EE2E0E791DD

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/? Action=LookupEvents
&<Common request parameters>

Sample success responses

XML format

<LookupEventsResponse>
		  <RequestId>FD79665A-CE8B-49D4-82E6-5EE2E0E791DD</RequestId>
		  <StartTime>2020-07-15T14:00:00Z</StartTime>
		  <EndTime>2020-07-22T14:00:00Z</EndTime>
</LookupEventsResponse>

JSON format

{
  "RequestId": "FD79665A-CE8B-49D4-82E6-5EE2E0E791DD",
  "Events": [],
  "StartTime": "2020-07-15T14:00:00Z",
  "EndTime": "2020-07-22T14:00:00Z"
}

Error codes

HttpCode Error code Error message Description
400 IncompleteSignature The request signature does not conform to Alibaba Cloud standards. The error message is returned because the request signature does not conform to the standards of Alibaba Cloud. Check whether the AccessKey ID and AccessKey secret are correct and whether the signature method is appropriate. For more information, see Signature method.
400 InvalidParameterCombination The end time must be later than the start time. The error message is returned because the end of the time range is earlier than or equal to the beginning.
400 InvalidQueryParameter The specified query parameter is invalid. The error message is returned because the specified request parameters are invalid.
400 InvalidParameterDateOutOfRange Query time range exceeds 30 days. The error message is returned because the specified time range exceeds 30 days.
400 InvalidParameterEndTime The specified EndTime is invalid. The error message is returned because the value of the EndTime parameter is invalid.
400 InvalidParameterStartTime The specified StartTime is invalid. The error message is returned because the StartTime parameter is invalid.
400 InvalidParameterStartTimeExceedsCurrent The StartTime exceeds the current time. Use GMT time format for queries. The error message is returned because the beginning of the time range is later than the current time. Specify a valid time range in UTC.
400 InvalidParameterStartTimeOutOfDate The StartTime exceeds the limit of 90 days. The error message is returned because the beginning of the time range is more than 90 days before the current time.
400 InvalidTimeRangeException The end time must be later than the start time. The time span cannot exceed 30 days. The error message is returned because the specified time range is invalid. The end of the time range is earlier than or equal to the beginning and the time range exceeds 30 days.

For a list of error codes, visit the API Error Center.