Abstract: AOC is a capability platform for automatic operation and maintenance of network equipment and third-party equipment management.

This article is shared by Oysterzz from Huawei Cloud community “AOC Meng New exploration Journey first – Online AOC Environment first Experience”.

Contact AOC has not been long, here this new plan to open a series of posts to record the daily learning process, some middle deep water area to help you, I hope to be able to help you.

I have touched the equipment before, tapped CLI to configure the equipment, and done the carrier network delivery. In terms of code, I am familiar with C. I have been engaged in the development of C for several years, and I have a superficial knowledge of Python and Java.

In fact, before I came into contact with AOC, I probably had a preliminary understanding that AOC is a platform for automated operation and maintenance of network equipment and third-party equipment management. To learn and experience AOC, I need an AOC, a network equipment, and a Python environment for code development. The Python development environment is easy, but what about AOC and network equipment? This is when I discovered the online development of the community home page.

After entering the online development page, these three are the AOC, Python environment, and network equipment I need. AOCmini offers an online version of AOC, CloudIDE offers an online Python environment, and AOCMONI offers an NE device emulator.

Enters the environment need huawei cloud real-name certification, here I met a problem, also saw the other junior partner in the community have met, after the real-name authentication again enters the environment or suggest not real-name certification, consulting the community support staff here, the problem is due to huawei cloud real-name authentication and database synchronization need a little time to trigger on this side of the community, It usually takes a few minutes to enter the environment.

This problem is also a stop of new a roadblock, actually this is huawei cloud in the background was a virtual machine for each developer, is also generous enough, after all, free trial, here still have the last doubt in his heart, is what the three tools together in the cloud, well no matter so much, first point check first.

I’ve got a bit of coding going on here, and the first one to go is the CLOUD IDE. The overall IDE interface is similar to that of PYCHARM and other mainstream ides. You can see ICONS related to plug-ins on the left and right side. It should be possible to download and install plug-ins from the CLOUD IDE app store.

You can see the blue AOC icon on the right

When I click on it, I can see that the IDE has the AOCmini and AOCmoni plug-in services installed by default. This also explains the last question in my mind, which is how the IDE, AOC environment, and device environment are connected.

You can see the debugging switch and the switch of opening the plug-in. Click “open” and AOCmoni and AOCmini were opened as expected. It can be basically confirmed here. The code developed in the IDE can run data through the plug-in function of the IDE and AOCmini and AOCmoni communication code debug, which basically meets the basic environment requirements of a developer to learn the development process

Let’s take a look at the debug feature and see how it works. In the CLOUD IDE and AOCmini we can see that the system presets an SSP package called AAamini

The SSP package from the IDE is loaded to AOCmini by default (we will see how to edit the package from the IDE and upload it to AOCmini next time). Now let’s try to debug the IDE and AOCmini together. First of all, turn on the debugging switch of AOC plug-in list, as shown in the figure below.

Then we find aaamini, the SSP package’s business Python file, and with “rich code experience” we lock the following file, which is actually quite easy to find because there are actually two real PY files, quietly blowing Python. The red box is the main business implementation file, and the yellow box is a UT test file.

Ncs_map this method should be the main entrance to do the model mapping when delivering the configuration, so let’s try it out first.

With the breakpoint on, we go to the business Management interface in AOCmini and click Add to add a configuration

You need to fill in your username and click Create;

At this point, we see that we need to fill in a nename, which device to send this configuration to.

Since we need to see which device to send, we need to know which devices AOC is now connected to. Click Resources -> Device Management, we can see that AOCmini is connected to a NE40E named NE1 by default, so we can fill in nename as NE1.

After clicking the test run, switch back to the IDE interface and click Run ->StartDebugging. You can see that the program in the IDE has been executed and pause at the breakpoint we just hit.

Click continue to finish running the program, and you can see that the AOCmini page pops up a dialog box with the test run results.

The ncs_map method actually combines the parameters we just entered on the web page into a netconf packet by mapping the jinja template as shown in the following figure.

The first time to record so much, in fact, is to experience the DEBUG function of AOC online environment, the middle also encountered some unexpected problems, but the overall process is relatively easy to understand, next time to continue to explore the online environment, including the package of editing and loading, I hope you can pay attention to more communication.

Click follow to learn about the fresh technologies of Huawei Cloud