CloudTrailClient.lookup_events
rboto-cloudtrail==0.4.0 · Service index · Types
Model summary (excerpt): Looks up management events or CloudTrail Insights events that are captured by CloudTrail. You can look up events that occurred in a Region within the last 90 days. LookupEvents returns recent Insights events for trails that enable Insights. To view Insights events for an event data store, you can run queries on your Insights event data store, and you can also view the Lake dashboard for...
Install and imports
from rboto import CloudTrailClient
from collections.abc import Sequence
from rboto_cloudtrail.types import (
EventCategory,
LookupAttribute,
LookupEventsOutput,
)
Signature
async def lookup_events(
*,
lookup_attributes: Sequence[LookupAttribute] | None = None,
start_time: str | None = None,
end_time: str | None = None,
event_category: EventCategory | None = None,
max_results: int | None = None,
next_token: str | None = None,
) -> LookupEventsOutput: ...
Arguments without defaults are required. None omits an optional request argument. Static types do not validate resource existence, permissions, lengths, ranges, or conditional service requirements.
Arguments
| Argument | Required | Model notes (excerpt) |
|---|---|---|
lookup_attributes |
No | Contains a list of lookup attributes. Currently the list can contain only one item. |
start_time |
No | Specifies that only events that occur after or at the specified time are returned. If the specified start time is after the specified end time, an error is returned. |
end_time |
No | Specifies that only events that occur before or at the specified time are returned. If the specified end time is before the specified start time, an error is returned. |
event_category |
No | Specifies the event category. If you do not specify an event category, events of the category are not returned in the response. For example, if you do not specify insight as the value of EventCategory , no Insights events are returned. |
max_results |
No | The number of events to return. Possible values are 1 through 50. The default is 50. |
next_token |
No | The token to use to get the next page of results after a previous API call. This token must be passed in with the same parameters that were specified in the original call. For example, if the original call specified an AttributeKey of 'Username' with a value of 'root', the call with NextToken should include those same parameters. |
Output
LookupEventsOutput.
Read-only native attributes, accessed as response.field. Collection getters materialize Python values; to_dict() recursively materializes a mapping. Streams are consumed once.
| Field | Type | Presence | References |
|---|---|---|---|
events |
list[EventOutput] | None |
Always present | EventOutput |
next_token |
str | None |
Always present | — |
| None means a value can be absent. Output mappings include every declared key; optional input keys may be omitted. Unknown output enum/union variants are not automatically valid inputs.
Related types
EventCategory, LookupAttribute, LookupEventsOutput
Follow these links for nested inputs and outputs; recursive types link back to the same type page.
Pagination and streaming
client.paginators.lookup_events(...) accepts the same arguments and returns AsyncIterator[LookupEventsOutput]. Direct calls return one page. Pages preserve the Output representation above.
Input cursors: next_token. Page-size argument: max_results.
No output stream.
Errors
Import from rboto_cloudtrail.exceptions:
InvalidEventCategoryError, InvalidLookupAttributesError, InvalidMaxResultsError, InvalidNextTokenError, InvalidTimeRangeError, OperationNotPermittedError, UnsupportedOperationError.
Other service failures use the service base error; credential, transport and timeout failures use shared errors.