Skip to content

batch_delete_automation_rules

batch_delete_automation_rules(
    *,
    config_overrides: Optional[SecurityHubClientConfig] = None,
    automation_rules_arns: Optional[AutomationRulesArnsList] = None,
) -> BatchDeleteAutomationRulesResponse

Deletes one or more automation rules.

Parameters:

  • automation_rules_arns (Optional[AutomationRulesArnsList], default: None ) –

    A list of Amazon Resource Names (ARNs) for the rules that are to be deleted.

Raises:

  • InternalException –

    Internal server error.

  • InvalidAccessException –

    The account doesn't have permission to perform this action.

  • InvalidInputException –

    The request was rejected because you supplied an invalid or out-of-range value for an input parameter.

  • LimitExceededException –

    The request was rejected because it attempted to create resources beyond the current Amazon Web Services account or throttling limits. The error code describes the limit exceeded.

  • ResourceNotFoundException –

    The request was rejected because we can't find the specified resource.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Examples:

To delete one or more automation rules The following example deletes the specified automation rules.

>>> client.batch_delete_automation_rules(automation_rules_arns=['arn:aws:securityhub:us-east-1:123456789012:automation-rule/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111', 'arn:aws:securityhub:us-east-1:123456789012:automation-rule/a1b2c3d4-5678-90ab-cdef-EXAMPLE22222'])
Source code in docs_src/capo_securityhub/_services/security_hub.py
def batch_delete_automation_rules(
    self,
    *,
    config_overrides: Optional[SecurityHubClientConfig] = None,
    automation_rules_arns: Optional[
        "capo_securityhub.types.automation_rules_arns_list.AutomationRulesArnsList"
    ] = None,
) -> "capo_securityhub.types.batch_delete_automation_rules_response.BatchDeleteAutomationRulesResponse":
    """<p> Deletes one or more automation rules. </p>

    Args:
        automation_rules_arns: <p> A list of Amazon Resource Names (ARNs) for the rules that are to be deleted. </p>

    Raises:
        capo_securityhub.errors.internal_exception.InternalException: <p>Internal server error.</p>
        capo_securityhub.errors.invalid_access_exception.InvalidAccessException: <p>The account doesn't have permission to perform this action.</p>
        capo_securityhub.errors.invalid_input_exception.InvalidInputException: <p>The request was rejected because you supplied an invalid or out-of-range value for an input parameter.</p>
        capo_securityhub.errors.limit_exceeded_exception.LimitExceededException: <p>The request was rejected because it attempted to create resources beyond the current Amazon Web Services account or throttling limits. The error code describes the limit exceeded.</p>
        capo_securityhub.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request was rejected because we can't find the specified resource.</p>
        capo_securityhub.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To delete one or more automation rules
        The following example deletes the specified automation rules.

        >>> client.batch_delete_automation_rules(automation_rules_arns=['arn:aws:securityhub:us-east-1:123456789012:automation-rule/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111', 'arn:aws:securityhub:us-east-1:123456789012:automation-rule/a1b2c3d4-5678-90ab-cdef-EXAMPLE22222'])
    """

    def _handler(
        req: "OperationRequest[capo_securityhub.types.batch_delete_automation_rules_request.BatchDeleteAutomationRulesRequest]",
    ) -> OperationResponse[
        "capo_securityhub.types.batch_delete_automation_rules_response.BatchDeleteAutomationRulesResponse"
    ]:
        import capo_securityhub._operations.security_hub_api_service.batch_delete_automation_rules

        output, http_response = (
            capo_securityhub._operations.security_hub_api_service.batch_delete_automation_rules.batch_delete_automation_rules(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("BatchDeleteAutomationRules")
    )
    input_: capo_securityhub.types.batch_delete_automation_rules_request.BatchDeleteAutomationRulesRequest = {}
    if automation_rules_arns is not None:
        input_["automation_rules_arns"] = automation_rules_arns

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output