Skip to content

describe_rule async

describe_rule(
    name: RuleName,
    *,
    config_overrides: Optional[AsyncCloudWatchEventsClientConfig] = None,
    event_bus_name: Optional[EventBusNameOrArn] = None,
) -> DescribeRuleResponse

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) –

    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.

Raises:

Source code in docs_src/capo_cloudwatch_events/_services/async_cloud_watch_events.py
async def describe_rule(
    self,
    name: "capo_cloudwatch_events.types.rule_name.RuleName",
    *,
    config_overrides: Optional[AsyncCloudWatchEventsClientConfig] = 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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cloudwatch_events.types.describe_rule_request.DescribeRuleRequest]",
    ) -> AsyncOperationResponse[
        "capo_cloudwatch_events.types.describe_rule_response.DescribeRuleResponse"
    ]:
        import capo_cloudwatch_events._operations.aws_events.describe_rule

        (
            output,
            http_response,
        ) = await capo_cloudwatch_events._operations.aws_events.describe_rule.async_describe_rule(
            req.options, req.input
        )
        return AsyncOperationResponse(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 = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output