02-08-2017 07:01 AM
Hello,
I have a requirement to deploy a template to all devices that are covered by a user-defined group. Currently the process I'm going through is something like:
1) Return list of user-defined groups with groups/userDefinedGroups
2) Identify the group I'm interested in and make a note of the group ID
3) Return list of devices within that group using devices/exportDevices
Unfortunately this returns credentials and IP address but not the device ID. Therefore I then have to lookup the ID for each device based on the IP address which seems inefficient to me.
To deploy the template I need an array of device IDs and I'm wondering if anyone can suggest a better way to retrieve the IDs for all devices within a user-defined group?
Running PI 3.1.5.
Thanks,
Dave
Solved! Go to Solution.
02-08-2017 08:46 AM
My suggestion: replace step 3 with data/Devices?.full=true&.group=/User%20Defined/MyGroup
That will get you the devices you need, with their IDs, and without fetching credentials.
02-08-2017 08:46 AM
My suggestion: replace step 3 with data/Devices?.full=true&.group=/User%20Defined/MyGroup
That will get you the devices you need, with their IDs, and without fetching credentials.
02-08-2017 08:50 AM
Good idea, thanks.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide