Skip to content

start_replay async

start_replay(
    replay_name: ReplayName,
    event_source_arn: ArchiveArn,
    event_start_time: Timestamp,
    event_end_time: Timestamp,
    destination: ReplayDestination,
    *,
    config_overrides: Optional[AsyncEventBridgeClientConfig] = None,
    description: Optional[ReplayDescription] = None,
) -> StartReplayResponse

Starts the specified replay. Events are not necessarily replayed in the exact same order that they were added to the archive. A replay processes events to replay based on the time in the event, and replays them using 1 minute intervals. If you specify an EventStartTime and an EventEndTime that covers a 20 minute time range, the events are replayed from the first minute of that 20 minute range first. Then the events from the second minute are replayed. You can use DescribeReplay to determine the progress of a replay. The value returned for EventLastReplayedTime indicates the time within the specified time range associated with the last event replayed.

Parameters:

  • replay_name (ReplayName) –

    The name of the replay to start.

  • description (Optional[ReplayDescription], default: None ) –

    A description for the replay to start.

  • event_source_arn (ArchiveArn) –

    The ARN of the archive to replay events from.

  • event_start_time (Timestamp) –

    A time stamp for the time to start replaying events. Only events that occurred between the EventStartTime and EventEndTime are replayed.

  • event_end_time (Timestamp) –

    A time stamp for the time to stop replaying events. Only events that occurred between the EventStartTime and EventEndTime are replayed.

  • destination (ReplayDestination) –

    A ReplayDestination object that includes details about the destination for the replay.

Raises:

Source code in docs_src/capo_eventbridge/_services/async_event_bridge.py
async def start_replay(
    self,
    replay_name: "capo_eventbridge.types.replay_name.ReplayName",
    event_source_arn: "capo_eventbridge.types.archive_arn.ArchiveArn",
    event_start_time: "capo_eventbridge.types.timestamp.Timestamp",
    event_end_time: "capo_eventbridge.types.timestamp.Timestamp",
    destination: "capo_eventbridge.types.replay_destination.ReplayDestination",
    *,
    config_overrides: Optional[AsyncEventBridgeClientConfig] = None,
    description: Optional[
        "capo_eventbridge.types.replay_description.ReplayDescription"
    ] = None,
) -> "capo_eventbridge.types.start_replay_response.StartReplayResponse":
    """<p>Starts the specified replay. Events are not necessarily replayed in the exact same order that they were added to the archive. A replay processes events to replay based on the time in the event, and replays them using 1 minute intervals. If you specify an <code>EventStartTime</code> and an <code>EventEndTime</code> that covers a 20 minute time range, the events are replayed from the first minute of that 20 minute range first. Then the events from the second minute are replayed. You can use <code>DescribeReplay</code> to determine the progress of a replay. The value returned for <code>EventLastReplayedTime</code> indicates the time within the specified time range associated with the last event replayed.</p>

    Args:
        replay_name: <p>The name of the replay to start.</p>
        description: <p>A description for the replay to start.</p>
        event_source_arn: <p>The ARN of the archive to replay events from.</p>
        event_start_time: <p>A time stamp for the time to start replaying events. Only events that occurred between the <code>EventStartTime</code> and <code>EventEndTime</code> are replayed.</p>
        event_end_time: <p>A time stamp for the time to stop replaying events. Only events that occurred between the <code>EventStartTime</code> and <code>EventEndTime</code> are replayed.</p>
        destination: <p>A <code>ReplayDestination</code> object that includes details about the destination for the replay.</p>

    Raises:
        capo_eventbridge.errors.internal_exception.InternalException: <p>This exception occurs due to unexpected causes.</p>
        capo_eventbridge.errors.invalid_event_pattern_exception.InvalidEventPatternException: <p>The event pattern is not valid.</p>
        capo_eventbridge.errors.limit_exceeded_exception.LimitExceededException: <p>The request failed because it attempted to create resource beyond the allowed service quota.</p>
        capo_eventbridge.errors.resource_already_exists_exception.ResourceAlreadyExistsException: <p>The resource you are trying to create already exists.</p>
        capo_eventbridge.errors.resource_not_found_exception.ResourceNotFoundException: <p>An entity that you specified does not exist.</p>
        capo_eventbridge.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_eventbridge.types.start_replay_request.StartReplayRequest]",
    ) -> AsyncOperationResponse[
        "capo_eventbridge.types.start_replay_response.StartReplayResponse"
    ]:
        import capo_eventbridge._operations.aws_events.start_replay

        (
            output,
            http_response,
        ) = await capo_eventbridge._operations.aws_events.start_replay.async_start_replay(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StartReplay")
    )
    input_: capo_eventbridge.types.start_replay_request.StartReplayRequest = {
        "replay_name": replay_name,
        "event_source_arn": event_source_arn,
        "event_start_time": event_start_time,
        "event_end_time": event_end_time,
        "destination": destination,
    }
    if description is not None:
        input_["description"] = description

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output