Cancels the specified replay.
Parameters:
-
replay_name
(ReplayName)
–
The name of the replay to cancel.
Raises:
Source code in docs_src/capo_cloudwatch_events/_services/async_cloud_watch_events.py
| async def cancel_replay(
self,
replay_name: "capo_cloudwatch_events.types.replay_name.ReplayName",
*,
config_overrides: Optional[AsyncCloudWatchEventsClientConfig] = None,
) -> "capo_cloudwatch_events.types.cancel_replay_response.CancelReplayResponse":
"""<p>Cancels the specified replay.</p>
Args:
replay_name: <p>The name of the replay to cancel.</p>
Raises:
capo_cloudwatch_events.errors.concurrent_modification_exception.ConcurrentModificationException: <p>There is concurrent modification on a rule, target, archive, or replay.</p>
capo_cloudwatch_events.errors.illegal_status_exception.IllegalStatusException: <p>An error occurred because a replay can be canceled only when the state is Running or Starting.</p>
capo_cloudwatch_events.errors.internal_exception.InternalException: <p>This exception occurs due to unexpected causes.</p>
capo_cloudwatch_events.errors.resource_not_found_exception.ResourceNotFoundException: <p>An entity that you specified does not exist.</p>
capo_cloudwatch_events.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_cloudwatch_events.types.cancel_replay_request.CancelReplayRequest]",
) -> AsyncOperationResponse[
"capo_cloudwatch_events.types.cancel_replay_response.CancelReplayResponse"
]:
import capo_cloudwatch_events._operations.aws_events.cancel_replay
(
output,
http_response,
) = await capo_cloudwatch_events._operations.aws_events.cancel_replay.async_cancel_replay(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("CancelReplay")
)
input_: capo_cloudwatch_events.types.cancel_replay_request.CancelReplayRequest = {
"replay_name": replay_name
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|