ElastiCache / Client / describe_events
describe_events#
- ElastiCache.Client.describe_events(**kwargs)#
Returns events related to clusters, cache security groups, and cache parameter groups. You can obtain events specific to a particular cluster, cache security group, or cache parameter group by providing the name as a parameter.
By default, only the events occurring within the last hour are returned; however, you can retrieve up to 14 days’ worth of events if necessary.
See also: AWS API Documentation
Request Syntax
response = client.describe_events( SourceIdentifier='string', SourceType='cache-cluster'|'cache-parameter-group'|'cache-security-group'|'cache-subnet-group'|'replication-group'|'user'|'user-group', StartTime=datetime(2015, 1, 1), EndTime=datetime(2015, 1, 1), Duration=123, MaxRecords=123, Marker='string' )
- Parameters:
SourceIdentifier (string) – The identifier of the event source for which events are returned. If not specified, all sources are included in the response.
SourceType (string) – The event source to retrieve events for. If no value is specified, all events are returned.
StartTime (datetime) –
The beginning of the time interval to retrieve events for, specified in ISO 8601 format.
Example: 2017-03-30T07:03:49.555Z
EndTime (datetime) –
The end of the time interval for which to retrieve events, specified in ISO 8601 format.
Example: 2017-03-30T07:03:49.555Z
Duration (integer) – The number of minutes worth of events to retrieve.
MaxRecords (integer) –
The maximum number of records to include in the response. If more records exist than the specified
MaxRecords
value, a marker is included in the response so that the remaining results can be retrieved.Default: 100
Constraints: minimum 20; maximum 100.
Marker (string) – An optional marker returned from a prior request. Use this marker for pagination of results from this operation. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by
MaxRecords
.
- Return type:
dict
- Returns:
Response Syntax
{ 'Marker': 'string', 'Events': [ { 'SourceIdentifier': 'string', 'SourceType': 'cache-cluster'|'cache-parameter-group'|'cache-security-group'|'cache-subnet-group'|'replication-group'|'user'|'user-group', 'Message': 'string', 'Date': datetime(2015, 1, 1) }, ] }
Response Structure
(dict) –
Represents the output of a
DescribeEvents
operation.Marker (string) –
Provides an identifier to allow retrieval of paginated results.
Events (list) –
A list of events. Each element in the list contains detailed information about one event.
(dict) –
Represents a single occurrence of something interesting within the system. Some examples of events are creating a cluster, adding or removing a cache node, or rebooting a node.
SourceIdentifier (string) –
The identifier for the source of the event. For example, if the event occurred at the cluster level, the identifier would be the name of the cluster.
SourceType (string) –
Specifies the origin of this event - a cluster, a parameter group, a security group, etc.
Message (string) –
The text of the event.
Date (datetime) –
The date and time when the event occurred.
Exceptions
ElastiCache.Client.exceptions.InvalidParameterValueException
ElastiCache.Client.exceptions.InvalidParameterCombinationException
Examples
Describes all the replication-group events from 3:00P to 5:00P on November 11, 2016.
response = client.describe_events( StartTime=datetime(2016, 12, 22, 15, 0, 0, 3, 357, 0), ) print(response)
Expected Output:
{ 'Events': [ { 'Date': datetime(2016, 12, 22, 21, 35, 46, 3, 357, 0), 'Message': 'Snapshot succeeded for snapshot with ID 'cr-bkup' of replication group with ID 'clustered-redis'', 'SourceIdentifier': 'clustered-redis-0001-001', 'SourceType': 'cache-cluster', }, { 'Date': datetime(2016, 12, 22, 16, 27, 56, 3, 357, 0), 'Message': 'Added cache node 0001 in availability zone us-east-1e', 'SourceIdentifier': 'redis-cluster', 'SourceType': 'cache-cluster', }, { 'Date': datetime(2016, 12, 22, 16, 27, 56, 3, 357, 0), 'Message': 'Cache cluster created', 'SourceIdentifier': 'redis-cluster', 'SourceType': 'cache-cluster', }, { 'Date': datetime(2016, 12, 22, 16, 5, 17, 3, 357, 0), 'Message': 'Added cache node 0002 in availability zone us-east-1c', 'SourceIdentifier': 'my-memcached2', 'SourceType': 'cache-cluster', }, { 'Date': datetime(2016, 12, 22, 16, 5, 17, 3, 357, 0), 'Message': 'Added cache node 0001 in availability zone us-east-1e', 'SourceIdentifier': 'my-memcached2', 'SourceType': 'cache-cluster', }, { 'Date': datetime(2016, 12, 22, 16, 5, 17, 3, 357, 0), 'Message': 'Cache cluster created', 'SourceIdentifier': 'my-memcached2', 'SourceType': 'cache-cluster', }, ], 'Marker': '', 'ResponseMetadata': { '...': '...', }, }