remove_targets
async
¶
remove_targets(
rule: RuleName,
ids: TargetIdList,
*,
config_overrides: Optional[AsyncCloudWatchEventsClientConfig] = None,
event_bus_name: Optional[EventBusNameOrArn] = None,
force: Optional[Boolean] = None,
) -> RemoveTargetsResponse
Removes the specified targets from the specified rule. When the rule is triggered, those targets are no longer be invoked.
When you remove a target, when the associated rule triggers, removed targets might continue to be invoked. Allow a short period of time for changes to take effect.
This action can partially fail if too many requests are made at the same time. If that happens, FailedEntryCount is non-zero in the response and each entry in FailedEntries provides the ID of the failed target and the error code.
Parameters:
-
rule(RuleName) –The name of the rule.
-
event_bus_name(Optional[EventBusNameOrArn], default:None) –The name or ARN of the event bus associated with the rule. If you omit this, the default event bus is used.
-
ids(TargetIdList) –The IDs of the targets to remove from the rule.
-
force(Optional[Boolean], default:None) –If this is a managed rule, created by an Amazon Web Services service on your behalf, you must specify
ForceasTrueto remove targets. This parameter is ignored for rules that are not managed rules. You can check whether a rule is a managed rule by usingDescribeRuleorListRulesand checking theManagedByfield of the response.
Raises:
-
ConcurrentModificationException–There is concurrent modification on a rule, target, archive, or replay.
-
InternalException–This exception occurs due to unexpected causes.
-
ManagedRuleException–This rule was created by an Amazon Web Services service on behalf of your account. It is managed by that service. If you see this error in response to
DeleteRuleorRemoveTargets, you can use theForceparameter in those calls to delete the rule or remove targets from the rule. You cannot modify these managed rules by usingDisableRule,EnableRule,PutTargets,PutRule,TagResource, orUntagResource. -
ResourceNotFoundException–An entity that you specified does not exist.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_cloudwatch_events/_services/async_cloud_watch_events.py
2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 | |