Hello,
How is the best way to achieve cleaning the device after 90 days without connecting ? I want to implement this policy.
Hello,
How is the best way to achieve cleaning the device after 90 days without connecting ? I want to implement this policy.
Define cleaning? Do you mean remove the device from the list? If that is your goal, there is no built-in mechanism to do this. You can write a script to do so. Query the NBI for devices where the _lastInform is on or before the date in question. Then you can spin through the _id in the output and send a DELETE to the server for that device id.
A safe pattern is two stages: first run a read-only NBI query with projection=_id for _lastInform on or before your cutoff, export or review those IDs, then loop and DELETE /devices/{id}. There is no built-in TTL, so schedule it with cron/systemd and log every deletion. If you may need history, tag devices as stale first and delete later. Test against a small batch before automating the full cleanup.