Skip to content

delete_insight_rules async

delete_insight_rules(
    *,
    config_overrides: Optional[AsyncCloudWatchClientConfig] = None,
    rule_names: Optional[InsightRuleNames] = None,
) -> DeleteInsightRulesOutput

Permanently deletes the specified Contributor Insights rules.

If you create a rule, delete it, and then re-create it with the same name, historical data from the first time the rule was created might not be available.

Parameters:

Raises:

Source code in docs_src/capo_cloudwatch/_services/async_cloud_watch.py
async def delete_insight_rules(
    self,
    *,
    config_overrides: Optional[AsyncCloudWatchClientConfig] = None,
    rule_names: Optional[
        "capo_cloudwatch.types.insight_rule_names.InsightRuleNames"
    ] = None,
) -> "capo_cloudwatch.types.delete_insight_rules_output.DeleteInsightRulesOutput":
    """<p>Permanently deletes the specified Contributor Insights rules.</p> <p>If you create a rule, delete it, and then re-create it with the same name, historical data from the first time the rule was created might not be available.</p>

    Args:
        rule_names: <p>An array of the rule names to delete. If you need to find out the names of your rules, use <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeInsightRules.html">DescribeInsightRules</a>.</p>

    Raises:
        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.delete_insight_rules_input.DeleteInsightRulesInput]",
    ) -> AsyncOperationResponse[
        "capo_cloudwatch.types.delete_insight_rules_output.DeleteInsightRulesOutput"
    ]:
        import capo_cloudwatch._operations.granite_service_version20100801.delete_insight_rules

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteInsightRules")
    )
    input_: capo_cloudwatch.types.delete_insight_rules_input.DeleteInsightRulesInput = {}
    if rule_names is not None:
        input_["rule_names"] = rule_names

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