Junos Space Developer
Junos Space Developer

Grouped configlet - getting details of what is selected

‎01-08-2018 02:12 AM

Hi - is there any way in space grouped configlets of detecting how many and what routers are selected. For example in a grouped configlet if the admin selects R1 and R2, then the configlet can

a) check whether two devices are selected and say you need to select a max of two routers

b) programmatically get the router details so it can generate say 'description "Tunnel between R1 and R2"' in the generated configlet


thanks in advance

Junos Space Developer

Re: Grouped configlet - getting details of what is selected

‎01-08-2018 07:37 AM

Hi Steve,

If you need to "coordinate" between 2 configlets, then you can use a Junos Space local script to invoke configlets via REST API.   The script can

1. marshal the required data,

2, invoke the configlets with the appropriate parameters

3. check configlet status and do any required error handling, cleanup or post-provision operations.


Andy introduced me to that technique a few years back.  Handling/parsing all JSON is a little tedious, but once you've done it once it's done.  Look around here to see Andy left any examples, and most of the heavy lifting will have been done.   


Pop back in here if you run into any snags.


"There he goes. One of God's own prototypes. A high-powered mutant of some kind never even considered for mass production. Too weird to live, and too rare to die." --HST