You can use this operation to temporarily stop receiving events from the specified partner event source. The matching event bus is not deleted.
When you deactivate a partner event source, the source goes into PENDING state. If it remains in PENDING state for more than two weeks, it is deleted.
To activate a deactivated partner event source, use ActivateEventSource.
Parameters:
-
name
(EventSourceName)
–
The name of the partner event source to deactivate.
Raises:
Source code in docs_src/capo_cloudwatch_events/_services/async_cloud_watch_events.py
| async def deactivate_event_source(
self,
name: "capo_cloudwatch_events.types.event_source_name.EventSourceName",
*,
config_overrides: Optional[AsyncCloudWatchEventsClientConfig] = None,
) -> None:
"""<p>You can use this operation to temporarily stop receiving events from the specified partner event source. The matching event bus is not deleted. </p> <p>When you deactivate a partner event source, the source goes into PENDING state. If it remains in PENDING state for more than two weeks, it is deleted.</p> <p>To activate a deactivated partner event source, use <a href="https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_ActivateEventSource.html">ActivateEventSource</a>.</p>
Args:
name: <p>The name of the partner event source to deactivate.</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.internal_exception.InternalException: <p>This exception occurs due to unexpected causes.</p>
capo_cloudwatch_events.errors.invalid_state_exception.InvalidStateException: <p>The specified state is not a valid state for an event source.</p>
capo_cloudwatch_events.errors.operation_disabled_exception.OperationDisabledException: <p>The operation you are attempting is not available in this region.</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.deactivate_event_source_request.DeactivateEventSourceRequest]",
) -> AsyncOperationResponse[None]:
import capo_cloudwatch_events._operations.aws_events.deactivate_event_source
(
output,
http_response,
) = await capo_cloudwatch_events._operations.aws_events.deactivate_event_source.async_deactivate_event_source(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeactivateEventSource")
)
input_: capo_cloudwatch_events.types.deactivate_event_source_request.DeactivateEventSourceRequest = {
"name": name
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|