Skip to content

list_audit_findings

list_audit_findings(
    *,
    config_overrides: Optional[IoTClientConfig] = None,
    task_id: Optional[AuditTaskId] = None,
    check_name: Optional[AuditCheckName] = None,
    resource_identifier: Optional[ResourceIdentifier] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
    start_time: Optional[Timestamp] = None,
    end_time: Optional[Timestamp] = None,
    list_suppressed_findings: Optional[ListSuppressedFindings] = None,
) -> ListAuditFindingsResponse

Lists the findings (results) of a Device Defender audit or of the audits performed during a specified time period. (Findings are retained for 90 days.)

Requires permission to access the ListAuditFindings action.

Parameters:

  • task_id (Optional[AuditTaskId], default: None ) –

    A filter to limit results to the audit with the specified ID. You must specify either the taskId or the startTime and endTime, but not both.

  • check_name (Optional[AuditCheckName], default: None ) –

    A filter to limit results to the findings for the specified audit check.

  • resource_identifier (Optional[ResourceIdentifier], default: None ) –

    Information identifying the noncompliant resource.

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

    The maximum number of results to return at one time. The default is 25.

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

    The token for the next set of results.

  • start_time (Optional[Timestamp], default: None ) –

    A filter to limit results to those found after the specified time. You must specify either the startTime and endTime or the taskId, but not both.

  • end_time (Optional[Timestamp], default: None ) –

    A filter to limit results to those found before the specified time. You must specify either the startTime and endTime or the taskId, but not both.

  • list_suppressed_findings (Optional[ListSuppressedFindings], default: None ) –

    Boolean flag indicating whether only the suppressed findings or the unsuppressed findings should be listed. If this parameter isn't provided, the response will list both suppressed and unsuppressed findings.

Raises:

Source code in docs_src/capo_iot/_services/io_t.py
def list_audit_findings(
    self,
    *,
    config_overrides: Optional[IoTClientConfig] = None,
    task_id: Optional["capo_iot.types.audit_task_id.AuditTaskId"] = None,
    check_name: Optional["capo_iot.types.audit_check_name.AuditCheckName"] = None,
    resource_identifier: Optional[
        "capo_iot.types.resource_identifier.ResourceIdentifier"
    ] = None,
    max_results: Optional["capo_iot.types.max_results.MaxResults"] = None,
    next_token: Optional["capo_iot.types.next_token.NextToken"] = None,
    start_time: Optional["capo_iot.types.timestamp.Timestamp"] = None,
    end_time: Optional["capo_iot.types.timestamp.Timestamp"] = None,
    list_suppressed_findings: Optional[
        "capo_iot.types.list_suppressed_findings.ListSuppressedFindings"
    ] = None,
) -> "capo_iot.types.list_audit_findings_response.ListAuditFindingsResponse":
    """<p>Lists the findings (results) of a Device Defender audit or of the audits performed during a specified time period. (Findings are retained for 90 days.)</p> <p>Requires permission to access the <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions">ListAuditFindings</a> action.</p>

    Args:
        task_id: <p>A filter to limit results to the audit with the specified ID. You must specify either the taskId or the startTime and endTime, but not both.</p>
        check_name: <p>A filter to limit results to the findings for the specified audit check.</p>
        resource_identifier: <p>Information identifying the noncompliant resource.</p>
        max_results: <p>The maximum number of results to return at one time. The default is 25.</p>
        next_token: <p>The token for the next set of results.</p>
        start_time: <p>A filter to limit results to those found after the specified time. You must specify either the startTime and endTime or the taskId, but not both.</p>
        end_time: <p>A filter to limit results to those found before the specified time. You must specify either the startTime and endTime or the taskId, but not both.</p>
        list_suppressed_findings: <p> Boolean flag indicating whether only the suppressed findings or the unsuppressed findings should be listed. If this parameter isn't provided, the response will list both suppressed and unsuppressed findings. </p>

    Raises:
        capo_iot.errors.internal_failure_exception.InternalFailureException: <p>An unexpected error has occurred.</p>
        capo_iot.errors.invalid_request_exception.InvalidRequestException: <p>The request is not valid.</p>
        capo_iot.errors.throttling_exception.ThrottlingException: <p>The rate exceeds the limit.</p>
        capo_iot.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_iot.types.list_audit_findings_request.ListAuditFindingsRequest]",
    ) -> OperationResponse[
        "capo_iot.types.list_audit_findings_response.ListAuditFindingsResponse"
    ]:
        import capo_iot._operations.aws_iot_service.list_audit_findings

        output, http_response = (
            capo_iot._operations.aws_iot_service.list_audit_findings.list_audit_findings(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListAuditFindings")
    )
    input_: capo_iot.types.list_audit_findings_request.ListAuditFindingsRequest = {}
    if task_id is not None:
        input_["task_id"] = task_id
    if check_name is not None:
        input_["check_name"] = check_name
    if resource_identifier is not None:
        input_["resource_identifier"] = resource_identifier
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token
    if start_time is not None:
        input_["start_time"] = start_time
    if end_time is not None:
        input_["end_time"] = end_time
    if list_suppressed_findings is not None:
        input_["list_suppressed_findings"] = list_suppressed_findings

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