Decommission host, Rest-api call: /v2/de-commission, PPDM login returns…
Set fullDecommissionState flag to IN_PROGRESS in config.yml.
Shutdown the scheduled/recurring jobs jobs
Block the http requests
Take backups of the dbs and retain the copies db alone
Call adonobj.unconfigure() TBD
New objects.db is created to record the agents which successded with unconfigure
delete certs and agentId
set fullDecommissionState to DONE
Return SUCCESS in rest-api call
1 more item...
Rest-api call: /v2/de-commission
PPDM login returns 409/405
runs unregister.bat using --decommission
shut down agentsvc
Call register.sh with --unregister flag
agentsvc checks the fullDecommissionState
If its IN_PROGRESS, complete the decommissioning and return msg n code.
register script to identify and explain the different btw modes?
If its Done: Exit with suitable msg.
If its RECOMMISSION: Say it cannot unregister since the sys is out of sync.
After the above 3 checks:
agentsvc calles the unregister api
If the login fails with 409/405, perform fullDecommission
if login succeeds and the no full decommission performed, then only perform the -decommission where agentsvc is not started on boot up
Set decommission flag to True.