Skip to content

list_managed_insight_rules async

list_managed_insight_rules(
    *,
    config_overrides: Optional[AsyncCloudWatchClientConfig] = None,
    resource_arn: Optional[AmazonResourceName] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[InsightRuleMaxResults] = None,
) -> ListManagedInsightRulesOutput

Returns a list that contains the number of managed Contributor Insights rules in your account.

Parameters:

  • resource_arn (Optional[AmazonResourceName], default: None ) –

    The ARN of an Amazon Web Services resource that has managed Contributor Insights rules.

  • next_token (Optional[NextToken], default: None ) –

    Include this value to get the next set of rules if the value was returned by the previous operation.

  • max_results (Optional[InsightRuleMaxResults], default: None ) –

    The maximum number of results to return in one operation. If you omit this parameter, the default number is used. The default number is 100.

Raises:

Source code in docs_src/capo_cloudwatch/_services/async_cloud_watch.py
async def list_managed_insight_rules(
    self,
    *,
    config_overrides: Optional[AsyncCloudWatchClientConfig] = None,
    resource_arn: Optional[
        "capo_cloudwatch.types.amazon_resource_name.AmazonResourceName"
    ] = None,
    next_token: Optional["capo_cloudwatch.types.next_token.NextToken"] = None,
    max_results: Optional[
        "capo_cloudwatch.types.insight_rule_max_results.InsightRuleMaxResults"
    ] = None,
) -> "capo_cloudwatch.types.list_managed_insight_rules_output.ListManagedInsightRulesOutput":
    """<p> Returns a list that contains the number of managed Contributor Insights rules in your account. </p>

    Args:
        resource_arn: <p> The ARN of an Amazon Web Services resource that has managed Contributor Insights rules. </p>
        next_token: <p> Include this value to get the next set of rules if the value was returned by the previous operation. </p>
        max_results: <p> The maximum number of results to return in one operation. If you omit this parameter, the default number is used. The default number is <code>100</code>. </p>

    Raises:
        capo_cloudwatch.errors.invalid_next_token.InvalidNextToken: <p>The next token specified is invalid.</p>
        capo_cloudwatch.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>The value of an input parameter is bad or out-of-range.</p>
        capo_cloudwatch.errors.missing_required_parameter_exception.MissingRequiredParameterException: <p>An input parameter that is required is missing.</p>
        capo_cloudwatch.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cloudwatch.types.list_managed_insight_rules_input.ListManagedInsightRulesInput]",
    ) -> AsyncOperationResponse[
        "capo_cloudwatch.types.list_managed_insight_rules_output.ListManagedInsightRulesOutput"
    ]:
        import capo_cloudwatch._operations.granite_service_version20100801.list_managed_insight_rules

        (
            output,
            http_response,
        ) = await capo_cloudwatch._operations.granite_service_version20100801.list_managed_insight_rules.async_list_managed_insight_rules(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListManagedInsightRules")
    )
    input_: capo_cloudwatch.types.list_managed_insight_rules_input.ListManagedInsightRulesInput = {}
    if resource_arn is not None:
        input_["resource_arn"] = resource_arn
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output