Extreme API with Python

Table Of Contents
Extreme API with Python
Page | 36
Part no.9036931-00 Rev AA February 2021
ev.sub(event_cb)
3.1.2.1 Create a Process
Enter the create process command and provide the necessary parameters:
The process name
The process creation (must be python-module)
The name of the Python application, without the .py suffix
The startup behavior, which can be either on-demand or auto
The VR from which you want it to run. The default is VR-Mgmt
The startup behavior, on-demand, runs once like a script would. Auto keeps the process running and
adds the config line into the config file so it can be automatically restarted when a switch is rebooted.
Assuming your previous code example was in a file named “test.py”, you would create the process:
sw1.26 # create process test python-module test start auto
Verify that the process is running:
sw1.27 # show process test
Process Name Version Restart State Start Time Group
-------------------------------------------------------------------------------
test User 0 LoadCfg Sun Jun 7 13:31:37 2020 Other
First verify that this process is present and running, then validate that it is running in the Other CGroup.
3.1.2.2 Create an Application
Manually create two VLANs, 42 and 43, and then connect something on the switch that will trigger the
UPM script you configured in the previous chapter (this adds the port that goes up to VLAN 42). You will
see the result on the switch, but no messages are displayed if you are connected via Telnet or SSH.
When working with process, a print is only redirected to the console. To access the information, you
must use the logging capability.
You must terminate and delete the process before you modify your program, after which you can
recreate the process.
sw1.48 # terminate process test graceful
Do you want to save configuration changes to currently selected configuration
file (primary.cfg)? (y or n) No
You will lose test's configuration if you save the configuration after
terminating this process. Do you want to continue? (y/N) Yes
Successful graceful termination for test
sw1.49 #
sw1.49 # delete process test