User Tools

Site Tools


guides:faq:tipstricks

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
guides:faq:tipstricks [2019/12/23 15:59] – ↷ Page moved from maintenance:general:tipstricks to guides:faq:tipstricks yspeerteguides:faq:tipstricks [2024/07/03 12:31] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +====== Tips & Tricks ======
 +This document is meant to group some examples, tricks and usage tips. 
 +
 +===== Templates =====
 +
 +==== Variable inside a relation ====
 +Need to find variables belonging to another from a port template. 
 +
 +A template example, using the //Bandwidth_up// value of the port-channel on the physical interface. Using the known //<Chan_id>// variable inside the relation: //PortChannels//
 +<code>service-policy output PM-<Bandwidth_up@PortChannels:Chan_id=<Chan_id>></code>
 +
 +===== Scenarios =====
 +
 +==== Modify context variable ====
 +In this example the node_class name is modified using the __Replace__ function. This is done using a regular expression.
 +
 +<code><type> := [Replace(<node_class>, '_.*', '')]</code>
 +Everything after the first _ (including the _) is removed and the value is assigned to the variable //type//
 +
 +eg. Before: ''WAN_env_CPE'', after: ''WAN''
 +
 +
  

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki