Licensing Requirements and Limitations for OPS
Involved Network Elements
Other network elements are not required.
Licensing Requirements
OPS is a basic feature of a switch and is not under license control.
Version Requirements
Product |
Product Model |
Software Version |
---|---|---|
S2700 | S2700SI | Not supported |
S2700EI | Not supported |
|
S2710SI | Not supported |
|
S2720EI | V200R012C00, V200R013C00 |
|
S2750EI | Not supported |
|
S3700 | S3700SI | Not supported |
S3700EI | Not supported |
|
S3700HI | Not supported |
|
S5700 | S5700LI | Not supported |
S5700S-LI | Not supported |
|
S5710-C-LI | Not supported |
|
S5710-X-LI | V200R012C00 |
|
S5720LI and S5720S-LI | V200R012(C00&C20), V200R013C00 |
|
S5700SI | Not supported |
|
S5720SI and S5720S-SI | V200R012C00, V200R013C00 |
|
S5720I-SI | V200R012C00, V200R013C00 |
|
S5700EI | Not supported |
|
S5710EI | Not supported |
|
S5720EI | V200R012C00, V200R013C00 |
|
S5700HI | Not supported |
|
S5710HI | Not supported |
|
S5720HI | V200R012C00, V200R013C00 |
|
S5730HI | V200R012C00, V200R013C00 |
|
S5730SI | V200R012C00, V200R013C00 |
|
S5730S-EI | V200R012C00, V200R013C00 |
|
S6700 | S6700EI | Not supported |
S6720EI | V200R012C00, V200R013C00 |
|
S6720S-EI | V200R012C00, V200R013C00 |
|
S6720SI and S6720S-SI | V200R012C00, V200R013C00 |
|
S6720LI and S6720S-LI | V200R012C00, V200R013C00 |
|
S6720HI | V200R012C00, V200R013C00 |
Feature Limitations
OPS Specifications
A maximum of 100 Python script assistants can be configured on a switch. On the S5720LI, S5720S-LI, S5720SI, S5720I-SI, and S5720S-SI, a maximum of six events subscribed in Python scripts can be matched simultaneously. On other switches, a maximum of ten events subscribed in Python scripts can be matched simultaneously.
A maximum of 100 user-defined environment variables are supported on a switch.
A maximum of 100 script variables are supported on a switch.
Precautions in Writing a Python Script
When the command line event subscription API (ops.cli.subscribe) is used:
If an original command of the switch is subscribed, sync is set to True, and the return value of ops_execute is set to 0, the original command of the switch is skipped, that is, the original CLI of the switch is invalid.
If an original command of the switch is subscribed, and sync and async_skip are set to False and True respectively, the original command of the switch is skipped, that is, the original CLI of the switch is invalid.
You are advised to specify the regular expression matching the command as a complete keyword or command.
If an incomplete command or keyword is used, and both enter and sync are set to True, the subscription event will be mismatched. For example, if the regular expression is set to display, any command that contains display will match the event and trigger the action in the function.
If an incomplete command or keyword is used, for example, dis, and enter, sync, and async_skip are set to True, False, and True respectively, all commands that contain dis will become invalid.
If an incomplete command or keyword is used, for example, display, and enter and sync are set to False and True respectively, any registered command that contains display will match the event and trigger the action in the function.
If an incomplete command or keyword is used, for example, display, and enter, sync, and async_skip are set to False, False, and True respectively, all registered commands that contain display will become invalid.
Do not specify the regular expression matching the command as a single space character.
When the regular expression is a single space character and the user enters only a single space, the action in the execution function cannot be triggered.
If the regular expression is a single space character, and enter, sync, and async_skip are set to True, True, and True respectively, the subscription event will be mismatched if you enter any command containing spaces.
If the regular expression is a single space character, and enter, sync, and async_skip are set to True, False, and True respectively, any command that contains spaces will be invalid.
If the regular expression matching the command contains a question mark (?), for example, "shutdow?", the subscription event cannot be matched if shutdow? is entered.
If the regular expression matching the command contains other special characters except for a question mark (?), the switch should perform conversion for special characters twice during Python script execution. Foe example, if the regular expression matching the command is "shutdown \\a", the regular expression becomes "shutdown \a" after the first conversion and becomes "shutdown a" after the second conversion. Therefore, the subscription event is matched if shutdown a is entered. You need to ensure that special characters become visible characters after the conversion is performed twice. Otherwise, the subscription event may not be matched because invisible characters cannot be entered in the CLI.
To prevent failures to copy or delete Python script files, ensure that the command lines subscribed using ops.cli.subscribe are different from the names of Python script files.
When a timer event subscription API (ops.timer.cron, ops.timer.relative, ops.timer.absolute, or ops.timer.countdown) is used and the timer is set improperly, for example, a short cycle is set when the ops.timer.relative API is used to set the cyclic timer.
If the action triggered by the timer is to restart the switch by running the reboot fast command, the switch restarts repeatedly. In this case, you can press Ctrl+B to enter the BootLoad menu when the switch is started and modify the configuration file to restore the switch.
If the action triggered by the timer is to restart the interface by running the restart (interface view) command, or shut down or restart the interface repeatedly by running the shutdown and undo shutdown commands, the interface cannot be used and the CPU usage of the switch increases, affecting the switch performance.
If the action triggered by the timer is to record logs, the logs of other service modules will be deleted as the flash memory space becomes smaller, affecting fault analysis and location.
In the Python script, if the CLI channel is opened using the ops.cli.open API, use the ops.cli.close API to close the CLI channel after commands are executed.
In OPS API, the value of a character string cannot contain \0.
Other Restrictions
OPS cannot be configured after the working mode of the switch is switched to the cloud-based management mode.
You can configure a Python script assistant only after the Python script is installed.
You need to be familiar with the Python language and correctly write Python scripts.
Switches running V200R012 support Python 2.7.3, and switches running V200R013 support Python 2.7.15. When editing a Python script, ensure that the used Python version matches the switch software version.