Skip to content

list_controls

list_controls(
    control_type: ControlType,
    *,
    config_overrides: Optional[AuditManagerClientConfig] = None,
    next_token: Optional[Token] = None,
    max_results: Optional[MaxResults] = None,
    control_catalog_id: Optional[ControlCatalogId] = None,
) -> ListControlsResponse

Returns a list of controls from Audit Manager.

Parameters:

  • control_type (ControlType) –

    A filter that narrows the list of controls to a specific type.

  • next_token (Optional[Token], default: None ) –

    The pagination token that's used to fetch the next set of results.

  • max_results (Optional[MaxResults], default: None ) –

    The maximum number of results on a page or for an API request call.

  • control_catalog_id (Optional[ControlCatalogId], default: None ) –

    A filter that narrows the list of controls to a specific resource from the Amazon Web Services Control Catalog.

    To use this parameter, specify the ARN of the Control Catalog resource. You can specify either a control domain, a control objective, or a common control. For information about how to find the ARNs for these resources, see ListDomains , ListObjectives , and ListCommonControls .

    You can only filter by one Control Catalog resource at a time. Specifying multiple resource ARNs isn’t currently supported. If you want to filter by more than one ARN, we recommend that you run the ListControls operation separately for each ARN.

    Alternatively, specify UNCATEGORIZED to list controls that aren't mapped to a Control Catalog resource. For example, this operation might return a list of custom controls that don't belong to any control domain or control objective.

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.

  • 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/audit_manager.py
def list_controls(
    self,
    control_type: "capo_auditmanager.types.control_type.ControlType",
    *,
    config_overrides: Optional[AuditManagerClientConfig] = None,
    next_token: Optional["capo_auditmanager.types.token.Token"] = None,
    max_results: Optional["capo_auditmanager.types.max_results.MaxResults"] = None,
    control_catalog_id: Optional[
        "capo_auditmanager.types.control_catalog_id.ControlCatalogId"
    ] = None,
) -> "capo_auditmanager.types.list_controls_response.ListControlsResponse":
    """<p> Returns a list of controls from Audit Manager. </p>

    Args:
        control_type: <p>A filter that narrows the list of controls to a specific type. </p>
        next_token: <p>The pagination token that's used to fetch the next set of results. </p>
        max_results: <p>The maximum number of results on a page or for an API request call. </p>
        control_catalog_id: <p>A filter that narrows the list of controls to a specific resource from the Amazon Web Services Control Catalog. </p> <p>To use this parameter, specify the ARN of the Control Catalog resource. You can specify either a control domain, a control objective, or a common control. For information about how to find the ARNs for these resources, see <a href="https://docs.aws.amazon.com/controlcatalog/latest/APIReference/API_ListDomains.html"> <code>ListDomains</code> </a>, <a href="https://docs.aws.amazon.com/controlcatalog/latest/APIReference/API_ListObjectives.html"> <code>ListObjectives</code> </a>, and <a href="https://docs.aws.amazon.com/controlcatalog/latest/APIReference/API_ListCommonControls.html"> <code>ListCommonControls</code> </a>.</p> <note> <p>You can only filter by one Control Catalog resource at a time. Specifying multiple resource ARNs isn’t currently supported. If you want to filter by more than one ARN, we recommend that you run the <code>ListControls</code> operation separately for each ARN. </p> </note> <p>Alternatively, specify <code>UNCATEGORIZED</code> to list controls that aren't mapped to a Control Catalog resource. For example, this operation might return a list of custom controls that don't belong to any control domain or control objective.</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.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.
    """

    def _handler(
        req: "OperationRequest[capo_auditmanager.types.list_controls_request.ListControlsRequest]",
    ) -> OperationResponse[
        "capo_auditmanager.types.list_controls_response.ListControlsResponse"
    ]:
        import capo_auditmanager._operations.bedrock_assessment_manager_lambda.list_controls

        output, http_response = (
            capo_auditmanager._operations.bedrock_assessment_manager_lambda.list_controls.list_controls(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListControls")
    )
    input_: capo_auditmanager.types.list_controls_request.ListControlsRequest = {
        "control_type": control_type
    }
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results
    if control_catalog_id is not None:
        input_["control_catalog_id"] = control_catalog_id

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