Skip to content

list_active_violations

list_active_violations(
    *,
    config_overrides: Optional[IoTClientConfig] = 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,
) -> ListActiveViolationsResponse

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 active violations for a given Device Defender security profile.

Requires permission to access the ListActiveViolations action.

Parameters:

Raises:

Source code in docs_src/capo_iot/_services/io_t.py
def list_active_violations(
    self,
    *,
    config_overrides: Optional[IoTClientConfig] = 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_active_violations_response.ListActiveViolationsResponse":
    """<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 active violations for a given Device Defender security profile.</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">ListActiveViolations</a> action.</p>

    Args:
        thing_name: <p>The name of the thing whose active violations are listed.</p>
        security_profile_name: <p>The name of the Device Defender security profile for which violations are listed.</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.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</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_active_violations_request.ListActiveViolationsRequest]",
    ) -> OperationResponse[
        "capo_iot.types.list_active_violations_response.ListActiveViolationsResponse"
    ]:
        import capo_iot._operations.aws_iot_service.list_active_violations

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListActiveViolations")
    )
    input_: capo_iot.types.list_active_violations_request.ListActiveViolationsRequest = {}
    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 = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output