Skip to content

list_violation_events async

list_violation_events(
    start_time: Timestamp,
    end_time: Timestamp,
    *,
    config_overrides: Optional[AsyncIoTClientConfig] = None,
    thing_name: Optional[DeviceDefenderThingName] = None,
    security_profile_name: Optional[SecurityProfileName] = None,
    behavior_criteria_type: Optional[BehaviorCriteriaType] = None,
    list_suppressed_alerts: Optional[ListSuppressedAlerts] = None,
    verification_state: Optional[VerificationState] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[MaxResults] = None,
) -> ListViolationEventsResponse

The IoT Device Defender detect feature will no longer be available to new customers starting August 31, 2026. If you would like to use the detect feature, sign up prior to August 31, 2026. To learn about alternatives to IoT Device Defender detect, see IoT Device Defender detect feature availability change in the IoT Device Defender Developer Guide. There is no change to IoT Device Defender audit availability.

Lists the Device Defender security profile violations discovered during the given time period. You can use filters to limit the results to those alerts issued for a particular security profile, behavior, or thing (device).

Requires permission to access the ListViolationEvents action.

Parameters:

  • start_time (Timestamp) –

    The start time for the alerts to be listed.

  • end_time (Timestamp) –

    The end time for the alerts to be listed.

  • thing_name (Optional[DeviceDefenderThingName], default: None ) –

    A filter to limit results to those alerts caused by the specified thing.

  • security_profile_name (Optional[SecurityProfileName], default: None ) –

    A filter to limit results to those alerts generated by the specified security profile.

  • behavior_criteria_type (Optional[BehaviorCriteriaType], default: None ) –

    The criteria for a behavior.

  • list_suppressed_alerts (Optional[ListSuppressedAlerts], default: None ) –

    A list of all suppressed alerts.

  • verification_state (Optional[VerificationState], default: None ) –

    The verification state of the violation (detect alarm).

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

    The token for the next set of results.

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

    The maximum number of results to return at one time.

Raises:

Source code in docs_src/capo_iot/_services/async_io_t.py
async def list_violation_events(
    self,
    start_time: "capo_iot.types.timestamp.Timestamp",
    end_time: "capo_iot.types.timestamp.Timestamp",
    *,
    config_overrides: Optional[AsyncIoTClientConfig] = None,
    thing_name: Optional[
        "capo_iot.types.device_defender_thing_name.DeviceDefenderThingName"
    ] = None,
    security_profile_name: Optional[
        "capo_iot.types.security_profile_name.SecurityProfileName"
    ] = None,
    behavior_criteria_type: Optional[
        "capo_iot.types.behavior_criteria_type.BehaviorCriteriaType"
    ] = None,
    list_suppressed_alerts: Optional[
        "capo_iot.types.list_suppressed_alerts.ListSuppressedAlerts"
    ] = None,
    verification_state: Optional[
        "capo_iot.types.verification_state.VerificationState"
    ] = None,
    next_token: Optional["capo_iot.types.next_token.NextToken"] = None,
    max_results: Optional["capo_iot.types.max_results.MaxResults"] = None,
) -> "capo_iot.types.list_violation_events_response.ListViolationEventsResponse":
    """<note> <p>The IoT Device Defender detect feature will no longer be available to new customers starting August 31, 2026. If you would like to use the detect feature, sign up prior to August 31, 2026. To learn about alternatives to IoT Device Defender detect, see IoT Device Defender detect feature availability change in the IoT Device Defender Developer Guide. There is no change to IoT Device Defender audit availability.</p> </note> <p>Lists the Device Defender security profile violations discovered during the given time period. You can use filters to limit the results to those alerts issued for a particular security profile, behavior, or thing (device).</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">ListViolationEvents</a> action.</p>

    Args:
        start_time: <p>The start time for the alerts to be listed.</p>
        end_time: <p>The end time for the alerts to be listed.</p>
        thing_name: <p>A filter to limit results to those alerts caused by the specified thing.</p>
        security_profile_name: <p>A filter to limit results to those alerts generated by the specified security profile.</p>
        behavior_criteria_type: <p> The criteria for a behavior. </p>
        list_suppressed_alerts: <p> A list of all suppressed alerts. </p>
        verification_state: <p>The verification state of the violation (detect alarm).</p>
        next_token: <p>The token for the next set of results.</p>
        max_results: <p>The maximum number of results to return at one time.</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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_iot.types.list_violation_events_request.ListViolationEventsRequest]",
    ) -> AsyncOperationResponse[
        "capo_iot.types.list_violation_events_response.ListViolationEventsResponse"
    ]:
        import capo_iot._operations.aws_iot_service.list_violation_events

        (
            output,
            http_response,
        ) = await capo_iot._operations.aws_iot_service.list_violation_events.async_list_violation_events(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListViolationEvents")
    )
    input_: capo_iot.types.list_violation_events_request.ListViolationEventsRequest = {
        "start_time": start_time,
        "end_time": end_time,
    }
    if thing_name is not None:
        input_["thing_name"] = thing_name
    if security_profile_name is not None:
        input_["security_profile_name"] = security_profile_name
    if behavior_criteria_type is not None:
        input_["behavior_criteria_type"] = behavior_criteria_type
    if list_suppressed_alerts is not None:
        input_["list_suppressed_alerts"] = list_suppressed_alerts
    if verification_state is not None:
        input_["verification_state"] = verification_state
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

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