Device is decommissioned by calling API
This operation follows steps:
- mark device as being under decomissioing (auto-block API access for device)
- schedule asyc-decomissioing job to delete device from other services
- Purge tokens
- Purge AuthSets
- Delete device from authentication
Depending on the load and circumstances asyc-job can take up to few minutes to delete the device. Therefore after successful delete request, device disappears from authentication however is available in different services (still displayed in UI). After few minutes it disappears.
This process is also fragile to errors on the way, as if workflow supports auto-retry while subsequent cleanups do not and fail on spot.
Transition entire cleanup logic into workflow itself. This way all cleanup steps are managed under single process and follow workflow retry policies.
- DELETE API marks device for decommissioning and schedules workflow (only logic).
- Deleting tokens, authsets and device from deviceauth is handled by decommissioning workflow similarly as other services are (internal delete api most likely)
- List devices API includes new status: "under decommissioning" that can be used by UI. Supported in status filter.
- Update docs to make clear that delete API is triggering asyc action.
- Remember to bump workflow version when making changes, it will not overwrite it with modified version if version is the same during update.