Skip to content

get_control async

get_control(
    control_id: UUID,
    *,
    config_overrides: Optional[AsyncAuditManagerClientConfig] = None,
) -> GetControlResponse

Gets information about a specified control.

Parameters:

  • control_id (UUID) –

    The identifier for the control.

Raises:

  • AccessDeniedException –

    Your account isn't registered with Audit Manager. Check the delegated administrator setup on the Audit Manager settings page, and try again.

  • InternalServerException –

    An internal service error occurred during the processing of your request. Try again later.

  • ResourceNotFoundException –

    The resource that's specified in the request can't be found.

  • ValidationException –

    The request has invalid or missing parameters.

  • UnknownServiceError –

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

Source code in docs_src/capo_auditmanager/_services/async_audit_manager.py
async def get_control(
    self,
    control_id: "capo_auditmanager.types.uuid.UUID",
    *,
    config_overrides: Optional[AsyncAuditManagerClientConfig] = None,
) -> "capo_auditmanager.types.get_control_response.GetControlResponse":
    """<p> Gets information about a specified control.</p>

    Args:
        control_id: <p> The identifier for the control. </p>

    Raises:
        capo_auditmanager.errors.access_denied_exception.AccessDeniedException: <p> Your account isn't registered with Audit Manager. Check the delegated administrator setup on the Audit Manager settings page, and try again. </p>
        capo_auditmanager.errors.internal_server_exception.InternalServerException: <p> An internal service error occurred during the processing of your request. Try again later. </p>
        capo_auditmanager.errors.resource_not_found_exception.ResourceNotFoundException: <p> The resource that's specified in the request can't be found. </p>
        capo_auditmanager.errors.validation_exception.ValidationException: <p> The request has invalid or missing parameters. </p>
        capo_auditmanager.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_auditmanager.types.get_control_request.GetControlRequest]",
    ) -> AsyncOperationResponse[
        "capo_auditmanager.types.get_control_response.GetControlResponse"
    ]:
        import capo_auditmanager._operations.bedrock_assessment_manager_lambda.get_control

        (
            output,
            http_response,
        ) = await capo_auditmanager._operations.bedrock_assessment_manager_lambda.get_control.async_get_control(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_auditmanager.types.get_control_response.GetControlResponse",
    ) -> dict[str, Any]:
        import capo_auditmanager.types.get_control_response

        return capo_auditmanager.types.get_control_response.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("GetControl", redact_output=_redact_output),
    )
    input_: capo_auditmanager.types.get_control_request.GetControlRequest = {
        "control_id": control_id
    }

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