Describes the specified rule.
DescribeRule does not list the targets of a rule. To see the targets associated with a rule, use ListTargetsByRule.
Parameters:
-
name
(RuleName)
–
-
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.
Raises:
Source code in docs_src/capo_cloudwatch_events/_services/cloud_watch_events.py
| def describe_rule(
self,
name: "capo_cloudwatch_events.types.rule_name.RuleName",
*,
config_overrides: Optional[CloudWatchEventsClientConfig] = None,
event_bus_name: Optional[
"capo_cloudwatch_events.types.event_bus_name_or_arn.EventBusNameOrArn"
] = None,
) -> "capo_cloudwatch_events.types.describe_rule_response.DescribeRuleResponse":
"""<p>Describes the specified rule.</p> <p>DescribeRule does not list the targets of a rule. To see the targets associated with a rule, use <a href="https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_ListTargetsByRule.html">ListTargetsByRule</a>.</p>
Args:
name: <p>The name of the rule.</p>
event_bus_name: <p>The name or ARN of the event bus associated with the rule. If you omit this, the default event bus is used.</p>
Raises:
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.
"""
def _handler(
req: "OperationRequest[capo_cloudwatch_events.types.describe_rule_request.DescribeRuleRequest]",
) -> OperationResponse[
"capo_cloudwatch_events.types.describe_rule_response.DescribeRuleResponse"
]:
import capo_cloudwatch_events._operations.aws_events.describe_rule
output, http_response = (
capo_cloudwatch_events._operations.aws_events.describe_rule.describe_rule(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DescribeRule")
)
input_: capo_cloudwatch_events.types.describe_rule_request.DescribeRuleRequest = {
"name": name
}
if event_bus_name is not None:
input_["event_bus_name"] = event_bus_name
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|