Junos Space Developer
Highlighted
Junos Space Developer

Space script parameters and variable annotations

‎04-30-2018 04:23 AM

Hi  - has anyone had any luck getting script parameters using xpath working in space.

What i want is a local script run from space to show a parameter of a drop down list of all the physical interfaces on a router. The documentation says you just need to do this but i can't get it to work  - the parameter always displays just a text field rather than the xpath drop down.

/*@VARIABLECONTEXT="[{'name':'XPATHVARIABLE1','defaultvalue'
:'mydefaultvalue','parameterscope':'devicespecific'},{'name'
:'XPATHVARIABLE2','configuredvaluexpath':'/device/interface-information/
physical-interface/name/text()','parameterscope':'entityspecific'},{'
name':'XPATHVARIABLE3','selectionvaluesxpath':'/device/
interface-information/physical-interface/name/text()','parameterscope':'global'}]"*/

 My code is:

/* @VARIABLECONTEXT="[{'name':'interface','selectionvaluesxpath':'/device/interface-information/physical-interface/name/text()','parameterscope':'global'}]"*/

var $arguments = {
    <argument> {
        <name>"interface";
        <description>"interface to toggle e.g. gi-1/0/0";
    }
}
param $interface;

Andy's fantstic example in https://forums.juniper.net/t5/Junos-Automation-Scripting/a-script-that-gathering-amount-of-the-input... also doesn't work so I'm thinking this is a bug in space 17.1

 

Appreciate any help before i log a jtac case

 

Steve

3 REPLIES 3
Highlighted
Junos Space Developer

Re: Space script parameters and variable annotations

‎04-30-2018 05:40 AM

Just a guess: but is "advanced xpath processing" enabled ?

--
"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

Attachments

Highlighted
Junos Space Developer

Re: Space script parameters and variable annotations

‎05-01-2018 07:11 AM

Yes - that option is enabled. Will log a JTAC case...

Highlighted
Junos Space Developer

Re: Space script parameters and variable annotations

‎05-02-2018 09:57 AM

 

What happens when you change your parameterscope from global to 'devicespecific' or 'entityspecific' ?

 

/doug

--
"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
Feedback