cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
974
Views
0
Helpful
3
Replies

Prime Infrastructure Template VTL Variable type declaration

Tobias Heisele
Level 1
Level 1

Hi,

 

I'm creating a CLI template to setup ip interfaces. For this, I need to add a number to a dropdown value, but Prime is only concating strings

 

#set ($lastoctett = $networkip + 3) --> if $networkip is 0, $lastocctett is 03 instead of 3, if $networkip is 16, $lastocctett is 163 instead of 19, ...

 

How can I make Prime handling my dropdownvalue as an integer?

3 Replies 3

Tobias Heisele
Level 1
Level 1

I tried $networkip.parseInt($networkip), but I do not get it working - any ideas?

pieterh
VIP
VIP

($lastoctett = $networkip + 3) ???
networkip is not a number but a combination of numbers and dots -> basically this is of type string
you first need to strip in separate octets before you do this

 

maybe you can refer to $ipaddress.lastoctet ???

or set ($lastoctett.number = $networkip + 3) ???

$networkip is the last octett of the network address, e.g 192.168.1.0 /24

Review Cisco Networking products for a $25 gift card