Parameters
Blitz uses the ‘%{parameter.x.y.z}’ markup to substitute values in action snippets at runtime. This allows for dynamic configuration and execution. LAMP keeps a dictionary of parameters, which can be used to substitute values & generate the parameter markup in Blitz snippets.
Why parameters
Using parameters instead of hardcoded values makes testcases more robust and generic. Markups, such as the parameter markup, help achieve this flexibility.
Basic usage
The ‘%’ symbol denotes a parameter in LAMP (think: ‘p’ for percentage and ‘p’ for parameter). To hide values such as device names, command arguments, or include/exclude entries, use the syntax ‘%{<PARAMETER_NAME>}’. This adds the ‘%{parameters.x.y.z}’ markup to the generated Blitz snippet, and LAMP interprets ‘%’ to substitute the parameter value during command execution.
For example:
<command> <arg1>can become<command> <%{name1}>where name1 = arg1INCLUDE> <entry1>can becomeINCLUDE> <%{name1}>where name1 = entry1
This markup allows commands and entries to be easily redirected to different values, enabling reuse of scripts for multiple scenarios.
Viewing, adding, removing, dumping LAMP parameters
Before using parameters, it’s important to know how to add, remove, and view LAMP parameters, as these are used in commands and arguments to generate Blitz snippets with parameter markups.
Add
Parameters can be added in two ways:
Add a new one using
parameter add.Import from YAML file via
parameter import.
To create a parameter from the shell, use parameter add. For example, to add a
parameter ‘intf_name’ with the value ‘Ethernet0/0’:
(lamp-leaf2) parameter add intf_name Ethernet0/0
parameter add uses literal evaluation, so entering 20 sets the parameter as an
integer, while ‘20’ sets it as a string. Strings in lists should be quoted to avoid
evaluation errors. For example, to add a list parameter:
(lamp-leaf2) parameter add devList "['leaf2', 'spine']"
To update an existing parameter, use the ‘-u’ option:
(lamp-host1) parameter add sleep_time 30
(lamp-host1) parameter add sleep_time 60 -u
Parameters can also be imported from YAML files:
(lamp-leaf2) parameter import pyats/parameters.yaml
View
Parameters can be viewed using parameter list, which prints all parameters as a
dictionary. The ‘%’ symbol is a shortcut for this command.
(lamp-leaf2) parameter list
{'intf_name': 'Ethernet0/0', 'devList': ['leaf2', 'spine'], 'sleep_mroute': 180}
(lamp-leaf2) %
{'intf_name': 'Ethernet0/0', 'devList': ['leaf2', 'spine'], 'sleep_mroute': 180}
Remove
Parameters can be removed with parameter remove to keep the parameter space organized.
(lamp-leaf2) parameter remove intf_name
Dump
Parameters can be saved to a YAML file using parameter dump.
(lamp-leaf2) parameter dump pyats/parameters.yaml
If the file exists, an error is shown; use ‘-u’ to update parameters within the file. This allows parameters to be added to Blitz trigger YAML files:
(lamp-leaf2) parameter dump pyats/blitz_testcase.yaml -u
Using parameters
Parameters can be substituted for arguments in commands like device, execute,
configure, api, parse, and replay, as well as in include and
exclude entries.
device
Parameters can be used as arguments to the device command.
Example:
(lamp-leaf2) parameter add dev leaf2
(lamp-leaf2) device %{dev}
(lamp-leaf2) configure no logging console
2024-08-06 20:55:15: %LAMP-INFO: +..............................................................................+
2024-08-06 20:55:15: %LAMP-INFO: : Configure 'no logging console' on 'leaf2' :
2024-08-06 20:55:15: %LAMP-INFO: +..............................................................................+
2024-08-06 20:55:15,664: %UNICON-INFO: +++ leaf2 with via 'a': configure +++
config term
Enter configuration commands, one per line. End with CNTL/Z.
leaf2(config)#no logging console
leaf2(config)#end
leaf2#
(lamp-leaf2)
Note that the Blitz snippet generated by LAMP uses the parameter markup:
(lamp-leaf2) list 1
configure:
device: '%{parameters.dev}'
command: no logging console
Parameters can also be lists of device names to loop across multiple devices. Use ‘$’ to reference a list of devices in a parameter. For example:
(lamp-leaf2) parameter add devList "['leaf2', 'spine']"
(lamp-leaf2) device $%{devList}
(lamp-leaf2,spine)
When multiple devices are active, LAMP automatically generates a Blitz ‘loop’ action to iterate over each device. The loop variable is assigned the parameter markup, as illustrated below:
(lamp-leaf2,spine) configure no logging console
2024-08-07 12:07:23: %LAMP-INFO: +------------------------------------------------------------------------------+
2024-08-07 12:07:23: %LAMP-INFO: : Configure loop, length=2 :
2024-08-07 12:07:23: %LAMP-INFO: +------------------------------------------------------------------------------+
2024-08-07 12:07:23: %LAMP-INFO: +..............................................................................+
2024-08-07 12:07:23: %LAMP-INFO: : Configure 'no logging console' on 'leaf2' :
2024-08-07 12:07:23: %LAMP-INFO: +..............................................................................+
2024-08-07 12:07:23,105: %UNICON-INFO: +++ leaf2 with via 'a': configure +++
config term
Enter configuration commands, one per line. End with CNTL/Z.
leaf2(config)#no logging console
leaf2(config)#end
leaf2#
2024-08-07 12:07:23: %LAMP-INFO: +..............................................................................+
2024-08-07 12:07:23: %LAMP-INFO: : Configure 'no logging console' on 'spine' :
2024-08-07 12:07:23: %LAMP-INFO: +..............................................................................+
2024-08-07 12:07:23,514: %UNICON-INFO: +++ spine with via 'a': configure +++
config term
Enter configuration commands, one per line. End with CNTL/Z.
spine(config)#no logging console
spine(config)#end
spine#
(lamp-leaf2,spine) list 1
- loop:
loop_variable_name:
- dev
value:
- '%{parameters.devList}'
actions:
- configure:
device: '%VARIABLES{dev}'
command:
- no logging console
(lamp-leaf2,spine)
execute
Parameters can be used in include entries, such as for an IP address that may change:
(lamp-leaf2) parameter add nbrAddr 1.1.1.1
(lamp-leaf2) execute -i show ip route
2024-08-07 12:14:59: %LAMP-INFO: +..............................................................................+
2024-08-07 12:14:59: %LAMP-INFO: : Execute 'show ip route' on 'leaf2' :
2024-08-07 12:14:59: %LAMP-INFO: +..............................................................................+
2024-08-07 12:14:59,680: %UNICON-INFO: +++ leaf2 with via 'a': executing command 'show ip route' +++
show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, m - OMP
n - NAT, Ni - NAT inside, No - NAT outside, Nd - NAT DIA
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
H - NHRP, G - NHRP registered, g - NHRP registration summary
o - ODR, P - periodic downloaded static route, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR
& - replicated local route overrides by connected
Gateway of last resort is not set
1.0.0.0/32 is subnetted, 1 subnets
O 1.1.1.1 [110/3] via 20.1.1.1, 20:15:56, GigabitEthernet1/0/1
leaf2#
2024-08-07 12:14:59: %LAMP-INFO: +..............................................................................+
2024-08-07 12:14:59: %LAMP-INFO: : INCLUDE :
2024-08-07 12:14:59: %LAMP-INFO: +..............................................................................+
Enter pattern to INCLUDE (Press enter for multiple patterns): %{nbrAddr}
(lamp-leaf2)
The generated Blitz snippet will use the parameter markup:
(lamp-leaf2) list 1
execute:
device: leaf2
command: show ip route
include:
- '%{parameters.nbrAddr}'
(lamp-leaf2)
If a parameter value does not match the output for an include entry, LAMP prompts whether to add the entry:
2024-08-07 14:57:06: %LAMP-INFO: +..............................................................................+
2024-08-07 14:57:06: %LAMP-INFO: : INCLUDE :
2024-08-07 14:57:06: %LAMP-INFO: +..............................................................................+
Enter elements of the list you would like to INCLUDE (Press enter for multiple entries): %{nbrAddr}
Adding this entry would cause this blitz action to fail
Do you still want to add it (y/n):
Parameters can also be used directly in commands:
(lamp-host2) %
{'ip': '1.1.1.1'}
(lamp-host2)
(lamp-host2) execute show ip route %{ip}
2025-09-23 16:33:33: %LAMP-INFO: +..............................................................................+
2025-09-23 16:33:33: %LAMP-INFO: : Execute 'show ip route 1.1.1.1' on 'host2' :
2025-09-23 16:33:33: %LAMP-INFO: +..............................................................................+
2025-09-23 16:33:33,610: %UNICON-INFO: +++ host2 with via 'cli': executing command 'show ip route 1.1.1.1' +++
show ip route 1.1.1.1
Routing entry for 1.1.1.1/32
Known via "connected", distance 0, metric 0 (connected)
Routing Descriptor Blocks:
* directly connected, via Loopback0
Route metric is 0, traffic share count is 1
host2#
(lamp-ios2) list 1
- execute:
device: ios2
command: show ip route %{parameters.ip}
(lamp-ios2)
parse
Parameters can be used in Dq shorthand queries for validation.
Check the below example where the IP address is a parameter and used in the Dq query:
(lamp-host3) parse -i show ip route
2025-08-29 14:44:05: %LAMP-INFO: +..............................................................................+
2025-08-29 14:44:05: %LAMP-INFO: : Parse 'show ip route' on 'host3' :
2025-08-29 14:44:05: %LAMP-INFO: +..............................................................................+
2025-08-29 14:44:06,486: %UNICON-INFO: +++ host3 with via 'a': executing command 'show ip route' +++
show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, m - OMP
n - NAT, Ni - NAT inside, No - NAT outside, Nd - NAT DIA
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
H - NHRP, G - NHRP registered, g - NHRP registration summary
o - ODR, P - periodic downloaded static route, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR
& - replicated local route overrides by connected
Gateway of last resort is not set
1.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 1.1.1.0/24 is directly connected, Ethernet0/0
L 1.1.1.1/32 is directly connected, Ethernet0/0
host3#
2025-08-29 14:44:06: %LAMP-INFO: +..............................................................................+
2025-08-29 14:44:06: %LAMP-INFO: : Parsed output :
2025-08-29 14:44:06: %LAMP-INFO: +..............................................................................+
{
'vrf': {
'default': {
'address_family': {
'ipv4': {
'routes': {
'1.1.1.0/24': {
'route': '1.1.1.0/24',
'active': True,
'source_protocol_codes': 'C',
'source_protocol': 'connected',
'next_hop': {
'outgoing_interface': {'Ethernet0/0': {'outgoing_interface': 'Ethernet0/0'}}
}
},
'1.1.1.1/32': {
'route': '1.1.1.1/32',
'active': True,
'source_protocol_codes': 'L',
'source_protocol': 'local',
'next_hop': {
'outgoing_interface': {'Ethernet0/0': {'outgoing_interface': 'Ethernet0/0'}}
}
}
}
}
}
}
}
}
2025-08-29 14:44:06: %LAMP-INFO: +..............................................................................+
2025-08-29 14:44:06: %LAMP-INFO: : Collecting INCLUDE Entries :
2025-08-29 14:44:06: %LAMP-INFO: +..............................................................................+
ROOT
└── (1) vrf
└── (2) default
└── (3) address_family
└── (4) ipv4
└── (5) routes
├── (6) 1.1.1.0/24
│ ├── (7) route: 1.1.1.0/24
│ ├── (8) active: True
│ ├── (9) source_protocol_codes: C
│ ├── (10) source_protocol: connected
│ └── (11) next_hop
│ └── (12) outgoing_interface
│ └── (13) Ethernet0/0
│ └── (14) outgoing_interface: Ethernet0/0
└── (15) 1.1.1.1/32
├── (16) route: 1.1.1.1/32
├── (17) active: True
├── (18) source_protocol_codes: L
├── (19) source_protocol: local
└── (20) next_hop
└── (21) outgoing_interface
└── (22) Ethernet0/0
└── (23) outgoing_interface: Ethernet0/0
Enter Dq item (or) line numbers (Press enter for multiple entries): ipv4,default,%{nbrAddr}
contains('ipv4').contains('default').contains(".*%{nbrAddr}.*", regex=True)
{
'vrf': {
'default': {
'address_family': {
'ipv4': {
'routes': {
'1.1.1.1/32': {
'route': '1.1.1.1/32',
'active': True,
'source_protocol_codes': 'L',
'source_protocol': 'local',
'next_hop': {
'outgoing_interface': {'Ethernet0/0': {'outgoing_interface': 'Ethernet0/0'}}
}
}
}
}
}
}
}
}
Do you wish to add this Dq query (Y/n):
(lamp-host3) list 1
- parse:
device: host3
command: show ip route
include:
- contains('ipv4').contains('default').contains(".*%{parameters.nbrAddr}.*", regex=True)
(lamp-host3)
Here is another short example highlighting parameter usage with ‘contains_key_value’ shorthand:
With Value : ipv4,default,1.1.1.1,outgoing_interface=GigabitEthernet1/0/1
With Parameter: ipv4,default,%{nbrAddr},outgoing_interface=%{nbrIntf}
The Dq query itself can also be stored as a parameter and used in include or exclude entries.
configure
Configurations can be masked under a parameter, allowing dynamic changes based on testbed or scenario. For example, a configuration under ‘rpfsync_cfg’ can be set to an empty string if not supported:
(lamp-leaf2) parameter add rpfsync_cfg "ip multicast redundancy rpf-sync"
(lamp-leaf2) configure
leaf2(config)# %{rpfsync_cfg}
Applied config: ip multicast redundancy rpf-sync
leaf2(config)# lamp
(lamp-leaf2)
(lamp-leaf2) list 1
configure:
device: leaf2
command: '%{parameters.rpfsync_cfg}'
(lamp-leaf2)
api
API arguments and its include/exclude entries can use parameters:
(lamp-host1) parameter add vrf_name red
(lamp-host1) parameter add intf_name Loopback99
(lamp-host1)
(lamp-host1) api -i get_vrf_interface
Gets the subinterfaces for vrf
Args:
device ('obj'): device to run on
vrf ('str'): vrf to search under
Returns:
interfaces('list'): List of interfaces under specified vrf
None
Raises:
None
device: [<Device host1 at 0x7fc896de17c0>]
vrf: %{vrf_name}
2024-08-07 14:55:01: %LAMP-INFO: +..............................................................................+
2024-08-07 14:55:01: %LAMP-INFO: : Api 'get_vrf_interface' with parameters: :
2024-08-07 14:55:01: %LAMP-INFO: : device: host1 :
2024-08-07 14:55:01: %LAMP-INFO: : vrf: 'red' :
2024-08-07 14:55:01: %LAMP-INFO: +..............................................................................+
INFO:genie.libs.sdk.apis.iosxe.vrf.get:Getting the interfaces under vrf red
2024-08-07 14:55:02,214: %UNICON-INFO: +++ host1 with via 'a': executing command 'show vrf red' +++
show vrf red
Name Default RD Protocols Interfaces
red <not set> Lo99
host1#
2024-08-07 14:55:02: %LAMP-INFO: +..............................................................................+
2024-08-07 14:55:02: %LAMP-INFO: : Api output: :
2024-08-07 14:55:02: %LAMP-INFO: +..............................................................................+
['Loopback99']
2024-08-07 14:55:02: %LAMP-INFO: +..............................................................................+
2024-08-07 14:55:02: %LAMP-INFO: +..............................................................................+
2024-08-07 14:55:02: %LAMP-INFO: : Collecting INCLUDE entries :
2024-08-07 14:55:02: %LAMP-INFO: +..............................................................................+
Enter elements of the list you would like to INCLUDE (Press enter for multiple entries): %{intf_name}
(lamp-host1)
(lamp-host1) list 1
api:
function: get_vrf_interface
arguments:
device: host1
vrf: '%{parameters.vrf_name}'
include:
- '%{parameters.intf_name}'
(lamp-host1)
replay
On replaying a Blitz testcase using replay, the parameter markups contained access
the LAMP parameter dictionary for corresponding values. This lookup happens before running,
hence if a parameter is missing, LAMP reports an error at the start of the execution.
A simple example illustrating the same:
# tc.yaml
# 05 August 2024
# LAMP Generated testcase
tc:
source:
pkg: genie.libs.sdk
class: triggers.blitz.blitz.Blitz
devices:
- host2
test_sections:
- default:
- execute:
device: host2
command: show ip route
include:
- '%{parameters.nbrAddr}'
(lamp-host1) %
{}
(lamp-host1) replay pyats/testcases/tc.yaml
Parameter 'nbrAddr' not found
(lamp-host1)
After adding the parameter, replay runs successfully:
(lamp-host2) parameter add nbrAddr 2.2.2.2
(lamp-host2) replay pyats/testcases/tc.yaml
2024-08-07 15:01:01: %LAMP-INFO: +------------------------------------------------------------------------------+
2024-08-07 15:01:01: %LAMP-INFO: : Starting run_genie_sdk "tc" :
2024-08-07 15:01:01: %LAMP-INFO: +------------------------------------------------------------------------------+
2024-08-07 15:01:01: %LAMP-INFO: +------------------------------------------------------------------------------+
2024-08-07 15:01:01: %LAMP-INFO: : Starting section "default" :
2024-08-07 15:01:01: %LAMP-INFO: +------------------------------------------------------------------------------+
2024-08-07 15:01:01: %LAMP-INFO: +..............................................................................+
2024-08-07 15:01:01: %LAMP-INFO: : Execute 'show ip route' on 'host2' :
2024-08-07 15:01:01: %LAMP-INFO: +..............................................................................+
2024-08-07 15:01:01,716: %UNICON-INFO: +++ host2 with via 'a': executing command 'show ip route' +++
show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, m - OMP
n - NAT, Ni - NAT inside, No - NAT outside, Nd - NAT DIA
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
H - NHRP, G - NHRP registered, g - NHRP registration summary
o - ODR, P - periodic downloaded static route, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR
& - replicated local route overrides by connected
Gateway of last resort is not set
2.0.0.0/32 is subnetted, 1 subnets
C 2.2.2.2 is directly connected, Loopback1
host2#
2024-08-07 15:01:01: %LAMP-INFO: +..............................................................................+
2024-08-07 15:01:01: %LAMP-INFO: : INCLUDE :
2024-08-07 15:01:01: %LAMP-INFO: +..............................................................................+
2024-08-07 15:01:01: %LAMP-INFO: : '2.2.2.2' matches :
2024-08-07 15:01:01: %LAMP-INFO: +..............................................................................+
2024-08-07 15:01:01: %LAMP-INFO: +..............................................................................+
2024-08-07 15:01:01: %LAMP-INFO: : run_genie_sdk results :
2024-08-07 15:01:01: %LAMP-INFO: +..............................................................................+
tc:
2024-08-07 15:01:01: %LAMP-INFO: +------------------------------------------------------------------------------+
2024-08-07 15:01:01: %LAMP-INFO: : run_genie_sdk PASSED :
2024-08-07 15:01:01: %LAMP-INFO: +------------------------------------------------------------------------------+
(lamp-host2)
Parameters can be included within a Blitz testcase and automatically imported during
replay using the ‘-ip’ option. This avoids missing parameter errors and cleans up
parameters after the run.
The trigger YAML shown below includes the ‘nbrAddr’ parameter directly in the testcase.
As a result, running replay -ip will not cause an ‘parameter not found’ error,
because it is automatically imported from the testcase file:
# tc.yaml
# 05 August 2024
# LAMP Generated testcase
parameters:
nbrAddr: 2.2.2.2
tc:
source:
pkg: genie.libs.sdk
class: triggers.blitz.blitz.Blitz
devices:
- host2
test_sections:
- default:
- execute:
device: host2
command: show ip route
include:
- '%{parameters.nbrAddr}'
(lamp-host2) %
{}
(lamp-host2)
(lamp-host2) replay -ip pyats/testcases/tc.yaml
2024-08-07 15:01:01: %LAMP-INFO: +------------------------------------------------------------------------------+
2024-08-07 15:01:01: %LAMP-INFO: : Starting run_genie_sdk "tc" :
2024-08-07 15:01:01: %LAMP-INFO: +------------------------------------------------------------------------------+
2024-08-07 15:01:01: %LAMP-INFO: +------------------------------------------------------------------------------+
2024-08-07 15:01:01: %LAMP-INFO: : Starting section "default" :
2024-08-07 15:01:01: %LAMP-INFO: +------------------------------------------------------------------------------+
2024-08-07 15:01:01: %LAMP-INFO: +..............................................................................+
2024-08-07 15:01:01: %LAMP-INFO: : Execute 'show ip route' on 'host2' :
2024-08-07 15:01:01: %LAMP-INFO: +..............................................................................+
2024-08-07 15:01:01,716: %UNICON-INFO: +++ host2 with via 'a': executing command 'show ip route' +++
show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, m - OMP
n - NAT, Ni - NAT inside, No - NAT outside, Nd - NAT DIA
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
H - NHRP, G - NHRP registered, g - NHRP registration summary
o - ODR, P - periodic downloaded static route, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR
& - replicated local route overrides by connected
Gateway of last resort is not set
2.0.0.0/32 is subnetted, 1 subnets
C 2.2.2.2 is directly connected, Loopback1
host2#
2024-08-07 15:01:01: %LAMP-INFO: +..............................................................................+
2024-08-07 15:01:01: %LAMP-INFO: : INCLUDE :
2024-08-07 15:01:01: %LAMP-INFO: +..............................................................................+
2024-08-07 15:01:01: %LAMP-INFO: : '2.2.2.2' matches :
2024-08-07 15:01:01: %LAMP-INFO: +..............................................................................+
2024-08-07 15:01:01: %LAMP-INFO: +..............................................................................+
2024-08-07 15:01:01: %LAMP-INFO: : run_genie_sdk results :
2024-08-07 15:01:01: %LAMP-INFO: +..............................................................................+
tc:
2024-08-07 15:01:01: %LAMP-INFO: +------------------------------------------------------------------------------+
2024-08-07 15:01:01: %LAMP-INFO: : run_genie_sdk PASSED :
2024-08-07 15:01:01: %LAMP-INFO: +------------------------------------------------------------------------------+
(lamp-host2)
(lamp-host2) %
{}
(lamp-host2)
It can be seen that the ‘nbrAddr’ parameter is not present in the LAMP parameter dictionary after the run, as it is only utilized during the trigger execution.
Note
In pyATS Blitz, parameters are statically assigned, meaning their values cannot be dynamically updated at runtime through parameter passing in ‘run_genie_sdk’. When using LAMP to generate a pyATS automation script, it’s recommended to declare parameters only once and store them in a shared common file. This helps maintain consistency and prevents potential mismatches during execution.
Parameter autocompletion
LAMP supports autocompletion for parameters in command arguments and include/exclude entries. Press <TAB> after ‘%{’ to see available parameters.
Examples:
In ‘config-prompt’ mode:
(lamp-host1) configure host1(config)# %{configs %{configs} %{configs.no_log_con} host1(config)# %{configs}
When entering arguments to
execute:(lamp-host1) execute show ip route %{intf_ %{intf_addr} %{intf_exc_addr} %{intf_name} (lamp-host1) execute show ip route %{intf_
When adding an include entry:
2024-10-05 19:28:31: %LAMP-INFO: +..............................................................................+ 2024-10-05 19:28:31: %LAMP-INFO: : INCLUDE : 2024-10-05 19:28:31: %LAMP-INFO: +..............................................................................+ Enter pattern to INCLUDE (Press enter for multiple patterns): %{intf_ %{intf_addr} %{intf_exc_addr} %{intf_name}