how to delete a detector?

0

I have a detector model set to 'detector for each unique key value'. After some testing, I have a number of detectors that I'd like to delete, or at least reset to their 'start' state.

Re-publishing a model warns that my detectors may be deleted, but that doesn't seem to happen.

Are there any options to delete a detector?

McMike
asked 4 years ago333 views
5 Answers
0

Hey,
After updating a detector model, an existing detector will remain in its current state until it receives a new message. Upon receiving a new message, the detector will be reset to the initial state, including the resetting of variables and timers. Completion of a timer will also cause the state of the detector to be reset if the detector has not yet received a new message.

If you want to reset the state of a specific detector without updating the detector model, you can use the batch-update-detector API (https://docs.aws.amazon.com/iotevents/latest/apireference/API_iotevents-data_BatchUpdateDetector.html)

Edited by: AndrewA-AWS on Nov 20, 2019 3:47 PM

Edited by: AndrewA-AWS on Nov 20, 2019 3:48 PM

AWS
answered 4 years ago
0

From what I'm seeing, re-publishing my model doesn't reset the detectors.

But the badge-update-detector command seems to do what I need:
aws iotevents-data batch-update-detector --cli-input-json file://reset_detector3.json

This will be a decent work-around, but in the future it would be really nice to have a 'Remove Detectors' button on my detector model's page in the console, and maybe a 'Delete' button from an individual detector's page.

Thanks for the help!

McMike
answered 4 years ago
0

After you republish the model, are you then sending new messages to each of the detectors you want to reset via batch-put-message?

Also, glad to hear you were able to use batch-update-detector.

AWS
answered 4 years ago
0

After I re-publish a model, I'm posting messages to MQTT, which an IoT rule forwards to the Events input feeding the detector. I'm not sure if that ends up using batch-put, internally to Events.

At some point in the future, it would be great to have a simple API to delete or reset a single detector, or all detectors attached to a model.

Thanks!

McMike
answered 4 years ago
0

AWS IoT Events has released a new API for deleting the detectors in batches.

AWS
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions