Hello!
OPS (Open Programmability System) allows users to develop and deploy network management policies using open RESTful APIs. With the programmability, OPS implements rapid service expansion, automatic deployment, and intelligent device management, helping reduce network O&M costs and facilitate network operations.
To implement OPS, perform the following operations:
1. Make a Python script. You can use a Python script to manage system resources through open RESTful APIs, for example, configure IP addresses for interfaces, and enable/disable interfaces.
Upload the Python script to a device and install the script.
Configure an assistant, and bind a trigger condition as well as the Python script to the assistant. When the trigger condition is met, the device executes the Python script. If the Python script is not bound to an assistant, the script can also be manually executed.
The following example describes how to implement OPS.
As shown in the figure on the right, uplink of SwitchA needs to be monitored so that the SwitchA can automatically set the downlink to Down when the uplink is Down.
1. Perform the following steps:
Make a Python script. The script enables a device to automatically set a downlink interface to Down when it detects that an uplink interface is Down.
2. Upload the Python script to SwitchA and install the script.
<HUAWEI> system-view
[~HUAWEI] sysname SwitchA
[*HUAWEI] commit
[~SwitchA] quit
ops install file shutdown.py
3. Configure an assistant on SwitchA, bind the trigger condition as an interface Down event, and configure the device to execute the Python script when the trigger condition is met.
<HUAWEI> system-view
[~SwitchA] ops
[~SwitchA-ops] assistant shutdownint
[*SwitchA-ops-assistant-shutdownint] condition alarm feature ifnet name linkDown
[*SwitchA-ops-assistant-shutdownint] execute 1 python shutdown.py
[*SwitchA-ops-assistant-shutdownint] commit
Best regards!