Skip to content

batch_get_security_controls async

batch_get_security_controls(
    *,
    config_overrides: Optional[AsyncSecurityHubClientConfig] = None,
    security_control_ids: Optional[StringList] = None,
) -> BatchGetSecurityControlsResponse

Provides details about a batch of security controls for the current Amazon Web Services account and Amazon Web Services Region.

Parameters:

  • security_control_ids (Optional[StringList], default: None ) –

    A list of security controls (identified with SecurityControlId, SecurityControlArn, or a mix of both parameters). The security control ID or Amazon Resource Name (ARN) is the same across standards.

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.

  • UnknownServiceError –

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

Examples:

To get security control details The following example gets details for the specified controls in the current AWS account and AWS Region.

>>> await client.batch_get_security_controls(security_control_ids=['ACM.1', 'APIGateway.1'])
Source code in docs_src/capo_securityhub/_services/async_security_hub.py
async def batch_get_security_controls(
    self,
    *,
    config_overrides: Optional[AsyncSecurityHubClientConfig] = None,
    security_control_ids: Optional[
        "capo_securityhub.types.string_list.StringList"
    ] = None,
) -> "capo_securityhub.types.batch_get_security_controls_response.BatchGetSecurityControlsResponse":
    """<p> Provides details about a batch of security controls for the current Amazon Web Services account and Amazon Web Services Region. </p>

    Args:
        security_control_ids: <p> A list of security controls (identified with <code>SecurityControlId</code>, <code>SecurityControlArn</code>, or a mix of both parameters). The security control ID or Amazon Resource Name (ARN) is the same across standards. </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.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To get security control details
        The following example gets details for the specified controls in the current AWS account and AWS Region.

        >>> await client.batch_get_security_controls(security_control_ids=['ACM.1', 'APIGateway.1'])
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_securityhub.types.batch_get_security_controls_request.BatchGetSecurityControlsRequest]",
    ) -> AsyncOperationResponse[
        "capo_securityhub.types.batch_get_security_controls_response.BatchGetSecurityControlsResponse"
    ]:
        import capo_securityhub._operations.security_hub_api_service.batch_get_security_controls

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("BatchGetSecurityControls")
    )
    input_: capo_securityhub.types.batch_get_security_controls_request.BatchGetSecurityControlsRequest = {}
    if security_control_ids is not None:
        input_["security_control_ids"] = security_control_ids

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