cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1030
Views
6
Helpful
1
Replies

Devices in Projects - stale entries

Seb Rupik
VIP Alumni
VIP Alumni

Hi all,

I'm writing a script which creates a PnP project populating it with devices based on assigned tags. You can't add a device to a project if it is present in an existing project, also the only way I can find to 'reset' a device and get it's state into PENDING is to delete the pnp-device object (there doesn't seem to be an applicable state you can assign via the PUT /pnp-device API call).

So after removing all my PnP projects and believing I have deleted all relevant PnP devices, I'm left in this strange state:

pnp.png

How can I have 50 devices in projects when none exist?

Clearly my API calls have caused some confusion to APIC-EM, but where does it get the number of 50 from?

Incidentally GET /pnp-device/count gives a result of 11, and listing them with GET /pnp-device , all of them were added to APIC-EM via discovery.

cheers,

Seb.

1 Reply 1

Seb Rupik
VIP Alumni
VIP Alumni

So I've got a little further...

GET /pnp-search with a 'state': 'PENDING' parameter, shows me all 50 devices with a 'site' value refernecing a non-existent project.

Using the serialNumber of a device and GET /pnp-device I retrieve the pnp-device ID which I used with DELETE /pnp-device/{deviceId}

This has done something to APIC-EM as after deleting one device it now looks like:

pnp2.png

Still, it would be good if APIC-EM did a sanity check to see if projects referenced by pnp-device objects actually existed.