官术网_书友最值得收藏!

Screen scraping versus API automation

For a long period of time, the CLI was the only access method available to manage and operate network devices. Operators and administrators used to have SSH and Telnet to access the network terminal for configuration and troubleshooting. Python, or any programming language, has two approaches to communicating with devices. The first one is to use SSH or telnet the same as before and get the information, then process it. This method is called screen scraping and requires libraries that will be able to establish a connection to the device and execute a command directly on the terminal, and other libraries to process the returned information to extract useful data from it. This method often requires knowledge of additional parsing languages, such as regular expressions, to match the data pattern from the output and extract useful data from it.

The second method is called an Application Programmable Interface (API) and this method depends entirely on sending a structured request using REST or SOAP protocols to the device and returning the output, also in structured format, encoded in JSON or XML. The time needed for processing the returned data in this method is quite small compared to the first method; however, the API requires additional configuration on network devices to support it.

主站蜘蛛池模板: 静乐县| 伊通| 兴国县| 大宁县| 东阳市| 禄劝| 靖安县| 越西县| 台北县| 德清县| 全椒县| 曲沃县| 奎屯市| 锦州市| 长岭县| 民乐县| 谢通门县| 正蓝旗| 甘南县| 宽城| 闻喜县| 碌曲县| 南充市| 饶河县| 安西县| 东港市| 五寨县| 北流市| 广丰县| 郎溪县| 田阳县| 鄂托克前旗| 吴江市| 林芝县| 友谊县| 项城市| 隆子县| 闻喜县| 德清县| 长乐市| 金湖县|