OpenSearchMemory / Client / list_events
list_events¶
- OpenSearchMemory.Client.list_events(**kwargs)¶
Lists the events in a session, sorted by time. Optionally limit the results to events whose
eventTimestampfalls betweeneventTimestampAfterandeventTimestampBefore. Returns event metadata only. CallGetEventfor the payload. For full-text or relevance search, useSearchEvents.If the space uses a customer managed AWS KMS key, the call can also fail because of the key. It fails with
AccessDeniedExceptionif you aren’t allowed to use the key, and withThrottlingExceptionif AWS KMS throttles the request. It fails withValidationExceptionif the key is disabled, pending deletion, or deleted.See also: AWS API Documentation
Request Syntax
response = client.list_events( spaceId='string', actorId='string', sessionId='string', eventTimestampBefore=datetime(2015, 1, 1), eventTimestampAfter=datetime(2015, 1, 1), sortOrder='ASC'|'DESC', metadataFilters={ 'string': 'string' }, maxResults=123, nextToken='string' )
- Parameters:
spaceId (string) –
[REQUIRED]
The ID of the space.
actorId (string) –
[REQUIRED]
The actor whose events to list.
sessionId (string) –
[REQUIRED]
The session whose events to list. To find events across sessions, use
SearchEvents.eventTimestampBefore (datetime) – Inclusive upper bound on
eventTimestamp: only events at or before this time are returned. Omit for no upper bound.eventTimestampAfter (datetime) –
Inclusive lower bound on
eventTimestamp: only events at or after this time are returned. Omit for no lower bound.If it’s later than
eventTimestampBefore, the request fails withValidationException.sortOrder (string) – The order of the results by
eventTimestamp:ASCorDESC. The default isDESC, most recent first.metadataFilters (dict) –
Returns only events whose metadata contains every one of these key-value pairs. Omit, or leave empty, for no metadata filter. The service applies the filter after it reads events, so a page can hold fewer than
maxResultsevents, or none, and still return anextToken. Keep paging untilnextTokenis absent.(string) –
A metadata key: letters, digits, hyphens (
-), and underscores (_). Dots are not allowed, because a query uses dots to separate nested field names.(string) –
The value of a metadata entry.
maxResults (integer) – The maximum number of events to return, from 1 to 100. The default is 20.
nextToken (string) – The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.
- Return type:
dict
- Returns:
Response Syntax
{ 'events': [ { 'eventId': 'string', 'metadata': { 'string': 'string' }, 'eventTimestamp': datetime(2015, 1, 1) }, ], 'nextToken': 'string' }
Response Structure
(dict) –
events (list) –
The events, without their payloads. Call
GetEventfor an event’s payload.(dict) –
A summary of an event, as returned by
ListEvents. It doesn’t include the payload.eventId (string) –
The event’s ID.
metadata (dict) –
The event’s metadata tags, as supplied to
CreateEvent. May be empty.(string) –
A metadata key: letters, digits, hyphens (
-), and underscores (_). Dots are not allowed, because a query uses dots to separate nested field names.(string) –
The value of a metadata entry.
eventTimestamp (datetime) –
The time the event occurred.
nextToken (string) –
The token for the next set of results. Absent when there are no more results.
Exceptions