- Developed some code to add devices using the PUT Bulk Import API back on product version 3.0. Started testing that code with version 3.1 of the product where it discovered a new Admin State property. When you add a device with the API, it is always added in the Un-Managed state. As a consequence, none of the properties of the device are discovered.
- Is there a way to add a device in a Managed state with the API. If not, is there an API call to make the change the Admin State from Un-Managed to Managed.
This service behaves like the bulk import option available in the UI. After providing the names, addresses, and credentials a job is created. That job moves to successful completion once all of the devices are added. Once a device is added, Prime Infrastructure will attempt to connect to the device, collect inventory, and manage it. If this is successful, the device's admin status will move from Un-Managed to Managed. However, if the device is unreachable, if the credentials are incorrect, or the device is unresponsive, it will remain in the Un-Managed state.
To programmatically check the device's state, you can access the data/Devices resource. The managementStatus response parameter will show MANAGED_AND_SYNCHRONIZED and the reachability response parameter will show REACHABLE when it's successful. Otherwise, it could show MANAGED_BUT_CONFLICTINGCREDENTIALS or some other management state, and the collectionDetail response parameter will show the reason. For example, I initiated a job via the API to add two devices, one being a reachable device with all the correct credentials, the other being reachable but I specified some of the wrong credentials. For the first, it has a Managed admin status in the UI and shows as MANAGED_AND_SYNCHRONIZED via the UI. For the second, the UI shows Un-Managed, and the API shows the collectionDetail as "CLI Failure: Invalid Enable password."
- The only way could find that answer is with the API, which many customers will not know how to do.
You should be able to see this in the UI as well. In the Device Work Center (or what used to be called the Device Work Center, Inventory > Device Management > Network Devices), there's a collection status column that show the same information that the API response parameter does. You just have to click the little info icon. I don't have an instance with license limitations, but here's an example of a different type of collection failure.
Comments
0 comments
Please sign in to leave a comment.