NSO API using Python #3
Load blank.ssh.enabled.cfg
In this task, you will use a single maapi session with multiple transactions.
Create a script which iterates over the XE group and prints the hostname of each device Use a second transaction to print the gi2.254 address. Use a single session for both transactions.
Answer
Explanation
Using the maapi Session(), you can create multiple transactions without restarting the session. First you create the Maapi object as m, and then reference this object with the AAA details (user and context):
Next, you use another with block per transaction. Use start_read_trans() and start_write_trans() instead of single_read_trans() and single_write_trans().
Last updated