Skip to content

describe_events

describe_events(
    *,
    config_overrides: Optional[ElastiCacheClientConfig] = None,
    source_identifier: Optional[String] = None,
    source_type: Optional[SourceType] = None,
    start_time: Optional[TStamp] = None,
    end_time: Optional[TStamp] = None,
    duration: Optional[IntegerOptional] = None,
    max_records: Optional[IntegerOptional] = None,
    marker: Optional[String] = None,
) -> EventsMessage

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.

Parameters:

  • source_identifier (Optional[String], default: None ) –

    The identifier of the event source for which events are returned. If not specified, all sources are included in the response.

  • source_type (Optional[SourceType], default: None ) –

    The event source to retrieve events for. If no value is specified, all events are returned.

  • start_time (Optional[TStamp], default: None ) –

    The beginning of the time interval to retrieve events for, specified in ISO 8601 format.

    Example: 2017-03-30T07:03:49.555Z

  • end_time (Optional[TStamp], default: None ) –

    The end of the time interval for which to retrieve events, specified in ISO 8601 format.

    Example: 2017-03-30T07:03:49.555Z

  • duration (Optional[IntegerOptional], default: None ) –

    The number of minutes worth of events to retrieve.

  • max_records (Optional[IntegerOptional], default: None ) –

    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 (Optional[String], default: None ) –

    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.

Raises:

Examples:

DescribeEvents Describes all the cache-cluster events for the past 120 minutes.

>>> client.describe_events(source_type='cache-cluster', duration=360)
DescribeEvents
Describes all the replication-group events from 3:00P to 5:00P on November 11, 2016.
>>> client.describe_events(start_time='2016-12-22T15:00:00.000Z')
Source code in docs_src/capo_elasticache/_services/elasti_cache.py
def describe_events(
    self,
    *,
    config_overrides: Optional[ElastiCacheClientConfig] = None,
    source_identifier: Optional["capo_elasticache.types.string.String"] = None,
    source_type: Optional["capo_elasticache.types.source_type.SourceType"] = None,
    start_time: Optional["capo_elasticache.types.t_stamp.TStamp"] = None,
    end_time: Optional["capo_elasticache.types.t_stamp.TStamp"] = None,
    duration: Optional[
        "capo_elasticache.types.integer_optional.IntegerOptional"
    ] = None,
    max_records: Optional[
        "capo_elasticache.types.integer_optional.IntegerOptional"
    ] = None,
    marker: Optional["capo_elasticache.types.string.String"] = None,
) -> "capo_elasticache.types.events_message.EventsMessage":
    """<p>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.</p> <p>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.</p>

    Args:
        source_identifier: <p>The identifier of the event source for which events are returned. If not specified, all sources are included in the response.</p>
        source_type: <p>The event source to retrieve events for. If no value is specified, all events are returned.</p>
        start_time: <p>The beginning of the time interval to retrieve events for, specified in ISO 8601 format.</p> <p> <b>Example:</b> 2017-03-30T07:03:49.555Z</p>
        end_time: <p>The end of the time interval for which to retrieve events, specified in ISO 8601 format.</p> <p> <b>Example:</b> 2017-03-30T07:03:49.555Z</p>
        duration: <p>The number of minutes worth of events to retrieve.</p>
        max_records: <p>The maximum number of records to include in the response. If more records exist than the specified <code>MaxRecords</code> value, a marker is included in the response so that the remaining results can be retrieved.</p> <p>Default: 100</p> <p>Constraints: minimum 20; maximum 100.</p>
        marker: <p>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 <code>MaxRecords</code>.</p>

    Raises:
        capo_elasticache.errors.invalid_parameter_combination_exception.InvalidParameterCombinationException: <p>Two or more incompatible parameters were specified.</p>
        capo_elasticache.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>The value for a parameter is invalid.</p>
        capo_elasticache.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        DescribeEvents
        Describes all the cache-cluster events for the past 120 minutes.

        >>> client.describe_events(source_type='cache-cluster', duration=360)
        DescribeEvents
        Describes all the replication-group events from 3:00P to 5:00P on November 11, 2016.

        >>> client.describe_events(start_time='2016-12-22T15:00:00.000Z')
    """

    def _handler(
        req: "OperationRequest[capo_elasticache.types.describe_events_message.DescribeEventsMessage]",
    ) -> OperationResponse["capo_elasticache.types.events_message.EventsMessage"]:
        import capo_elasticache._operations.amazon_elasti_cache_v9.describe_events

        output, http_response = (
            capo_elasticache._operations.amazon_elasti_cache_v9.describe_events.describe_events(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeEvents")
    )
    input_: capo_elasticache.types.describe_events_message.DescribeEventsMessage = {}
    if source_identifier is not None:
        input_["source_identifier"] = source_identifier
    if source_type is not None:
        input_["source_type"] = source_type
    if start_time is not None:
        input_["start_time"] = start_time
    if end_time is not None:
        input_["end_time"] = end_time
    if duration is not None:
        input_["duration"] = duration
    if max_records is not None:
        input_["max_records"] = max_records
    if marker is not None:
        input_["marker"] = marker

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output