Is there any way to outside the GUI to set all retired devices to active?

Document ID : KB000115988
Last Modified Date : 27/09/2018
Show Technical Document Details
Question:
Is there any way to outside the GUI to set all retired devices to active? 
Answer:
Here are the commands to set the devices to active. The first one gets all the Retired elements and puts them in a list. You will need to remove the fist line in the file /tmp/devices.txt it is a header.
1. mysql -unetqos -pnetqos netqosportal -e 'select itemid from t_device where LifeCycleState="Retired"';> /tmp/devices.txt
2. Edit /tmp/devices.txt to remove the first (header) line.
3. for ID in `cat /tmp/devices.txt`; do curl -v -X PUT -u admin:admin -H 'Content-type: acation/xml' http://<PC_SYSTEM>:8181/pc/center/webservice/devices/deviceItemId/$ID/lifeCycleState/Active; done