cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1724
Views
8
Helpful
2
Replies

Most efficient way to deploy template to all members of a user defined group

Dave Lewis
Level 1
Level 1

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

1 Accepted Solution

Accepted Solutions

Spencer Zier
Cisco Employee
Cisco Employee

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.

View solution in original post

2 Replies 2

Spencer Zier
Cisco Employee
Cisco Employee

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.

Good idea, thanks.