How to Remove a device from UIM using uimapi
search cancel

How to Remove a device from UIM using uimapi


Article ID: 232014


Updated On:


DX Unified Infrastructure Management (Nimsoft / UIM)


How can I remove devices from UIM Operator Console using uimapi, assuming I have a group with all the devices to be removed


Release : 20.3

Component : UIM - API


You can accomplish this using the devicegroups and devices endpoints


If you already have the devices to be deleted in a group, then you can run next endpoints to get the group id, retrieve the cs_id for the group members, and then delete all those devices:

1. Get the group id for <GROUP_NAME>

curl -X GET "http://<OC_FQDN>/uimapi/devicegroups?name=<GROUP_NAME>" -H "accept: application/xml"

2. Using the group id obtained from 1 (<ID_OBTAINED_IN_1>), you can list the devices members of the group 

curl -X GET "http://<OC_FQDN>/uimapi/devicegroups/<ID_OBTAINED_IN_1>/members" -H "accept: application/xml"

3.Using the devices id obtained in 2, you can delete those devices massively using the action "remove_master_devices" and adding all the device ids to remove.
   If the idea is prevent rediscovery, instead of "remove_master_devices", the action to use would be "blacklist_devices"

curl -X POST "http://<OC_FQDN>/uimapi/devices/bulk_actions" -H "accept: application/xml" -H "Content-Type: application/xml" -d "<?xml version=\"1.0\" encoding=\"UTF-8\"?><bulk_action>\t<action>remove_master_devices</action>\t<ids>{device_id_obtained_in_2}</ids> <ids>{device_id_obtained_in_2}</ids><ids>{device_id_obtained_in_2}</ids></bulk_action>"

    For instance, 

1. Let's get the ID of the group "ToBeRemoved". Assume the OC FQDN is

curl -X GET "" -H "accept: application/xml"

2. Then using the id obtained in 1, get the list of members for the group. Let's assume the ID returned from 1 was 35

curl -X GET "" -H "accept: application/xml"

3. Now with the list of cs_id that are member of the group, you may run the last part of the process to delete all those devices. Let's assume the group has 2 members, whose cs_id are 883 and 445

curl -X POST "" -H "accept: application/xml" -H "Content-Type: application/xml" -d "<?xml version=\"1.0\" encoding=\"UTF-8\"?><bulk_action>\t<action>remove_master_devices</action>\t<ids>883</ids> <ids>445</ids></bulk_action>

Additional Information

How do I delete decommissioned robots information from database.

uimapi APIs