Skip to content

batch_update_automation_rules async

batch_update_automation_rules(
    *,
    config_overrides: Optional[AsyncSecurityHubClientConfig] = None,
    update_automation_rules_request_items: Optional[
        UpdateAutomationRulesRequestItemsList
    ] = None,
) -> BatchUpdateAutomationRulesResponse

Updates one or more automation rules based on rule Amazon Resource Names (ARNs) and input parameters.

Parameters:

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 update one ore more automation rules The following example updates the specified automation rules.

>>> await client.batch_update_automation_rules(update_automation_rules_request_items=[{'RuleArn': 'arn:aws:securityhub:us-east-1:123456789012:automation-rule/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111', 'RuleStatus': 'ENABLED', 'RuleOrder': 15}, {'RuleArn': 'arn:aws:securityhub:us-east-1:123456789012:automation-rule/a1b2c3d4-5678-90ab-cdef-EXAMPLE22222', 'RuleStatus': 'DISABLED'}])
Source code in docs_src/capo_securityhub/_services/async_security_hub.py
async def batch_update_automation_rules(
    self,
    *,
    config_overrides: Optional[AsyncSecurityHubClientConfig] = None,
    update_automation_rules_request_items: Optional[
        "capo_securityhub.types.update_automation_rules_request_items_list.UpdateAutomationRulesRequestItemsList"
    ] = None,
) -> "capo_securityhub.types.batch_update_automation_rules_response.BatchUpdateAutomationRulesResponse":
    """<p> Updates one or more automation rules based on rule Amazon Resource Names (ARNs) and input parameters. </p>

    Args:
        update_automation_rules_request_items: <p> An array of ARNs for the rules that are to be updated. Optionally, you can also include <code>RuleStatus</code> and <code>RuleOrder</code>. </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 update one ore more automation rules
        The following example updates the specified automation rules.

        >>> await client.batch_update_automation_rules(update_automation_rules_request_items=[{'RuleArn': 'arn:aws:securityhub:us-east-1:123456789012:automation-rule/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111', 'RuleStatus': 'ENABLED', 'RuleOrder': 15}, {'RuleArn': 'arn:aws:securityhub:us-east-1:123456789012:automation-rule/a1b2c3d4-5678-90ab-cdef-EXAMPLE22222', 'RuleStatus': 'DISABLED'}])
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_securityhub.types.batch_update_automation_rules_request.BatchUpdateAutomationRulesRequest]",
    ) -> AsyncOperationResponse[
        "capo_securityhub.types.batch_update_automation_rules_response.BatchUpdateAutomationRulesResponse"
    ]:
        import capo_securityhub._operations.security_hub_api_service.batch_update_automation_rules

        (
            output,
            http_response,
        ) = await capo_securityhub._operations.security_hub_api_service.batch_update_automation_rules.async_batch_update_automation_rules(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("BatchUpdateAutomationRules")
    )
    input_: capo_securityhub.types.batch_update_automation_rules_request.BatchUpdateAutomationRulesRequest = {}
    if update_automation_rules_request_items is not None:
        input_["update_automation_rules_request_items"] = (
            update_automation_rules_request_items
        )

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