Welcome back. It's now time to invoke net Miko functionality and use the previously defined parameters to establish the SSH connection to our Arista device. To do that, we're going to use the connection handler class from within the net Miko module. We don't need to prepend the name of this class with the name of the module, since we use the from import statement up here to import the class into the namespace of our application. In between the parentheses of connection handler, we need to reference the device type IP address, username and password, bypassing each of the variables we defined earlier to each of the corresponding arguments necessary for creating the SSH session. Additionally, we can add a value for the global delay factor argument to also cover the case when you have slow and laggy connections to your devices.
This way net Miko one throw an error immediately during the course. 500 milliseconds. Let's see if the device is slow to respond to its request that's introducing a small delay and keeping the application alive. In my case, I chose a delay of three seconds just to make sure everything runs smoothly. Next, after the SSH connection has been successfully established, we enter the Enable mode of the Arista command line interface or COI. Using the Enable method with no arguments so we can then be able to issue the show running command.
This command is passed to the switch using the Send command method as you can see, and the command variable from above as its argument. Of course, we are also storing the results of executing the show running command using a variable called output that we will later use to write the running configuration to a text file. But more on that in the next video. See you there.