No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

Configuration Guide - Device Management

S9300, S9300E, and S9300X V200R012C00

This document describes the configurations of Device Management, including device status query, hardware management, CSS, SVF, PoE, OPS, OIDS, energy-saving management, information center, fault management, NTP, synchronous ethernet, PTP.
Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
Opening CLI Channel

Opening CLI Channel

Interface Name

Opening CLI channel

Application Phase

Execution phase

API Prototype

result1_handle, result2_description = ops.cli.open()

Description

None

Return Value

The first return value is a command line handle. The value None indicates an error, while other values indicate command line handles.

The second return value is the failure cause when the first return value is None.

Usage Description

The user level of the CLI channel opened in the script is 15.

Commands can be delivered to a device only after the CLI channel is opened in a script.

Only one CLI channel can be created in a script. If you try to create the second CLI channel, the system will display a failure message.

A VTY resource is consumed each time a CLI channel is opened. To check which VTY resources have been occupied by Assistant: Name, run the display users command. When only three or less VTY resources are available, no more CLI channels can be opened. Therefore, after the CLI channel is created and commands are executed in the script, you need to close the CLI channel in time using Closing CLI Channel API (ops.cli.close (fd)) to save VTY resources.

The first return value of the opening CLI channel API is used as the input parameter of the Executeing CLI command and Closing CLI Channel APIs. So the return value must be specified when the opening CLI channel API is used.

Example

When a subscription event is matched, you can open the CLI channel and run related commands.

handle, descri_str = ops.cli.open()          # Open the CLI channel.
result, n11, n21 = ops.cli.execute(handle,"system-view")         # Run the system-view command to enter the system view.
result, n11, n21 = ops.cli.execute(handle,"ops")         # Run the ops command to enter the OPS view.
Translation
Download
Updated: 2018-09-03

Document ID: EDOC1100038289

Views: 43357

Downloads: 15

Average rating:
This Document Applies to these Products
Related Version
Related Documents
Share
Previous Next