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


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

RESTful API Reference
CloudEngine 12800 and 12800E V200R003C00

This document describes the OPS APIs supported by the device, including OPS-supported operations, request examples, elements in the requests, response examples, elements in the responses, and response status codes.

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).
Read User Inputs on User Terminals

Read User Inputs on User Terminals

  • Function Description

    The OPS provides an interface for reading user inputs on the CLI terminal when the Python script is being executed on the front end or the CLI terminal waits for script execution.

  • Command Prototype, timeout=30, vty=None)

  • Parameter Description
    Table 3-912  Parameters supported by APIs for reading user inputs on user terminals




    Specifies an OPS object. It is obtained using ops.ops() in instance mode.


    Specifies the maximum number of characters allowed to be input. The default value is 512 characters.


    Specifies a timeout period for waiting for user inputs. The default value is 30s.


    Specifies a user terminal. Currently, user inputs can be read only on user terminals that wait for script execution or execute the script on the front end.

    You can enter environment('_cli_vty') to obtain the VTY name or enter None.

  • Description of Return Values

    None: indicates a user input timeout, a user has entered CTRL+C, or the parameter is incorrect.

    Null character string: indicates that a user has pressed Enter.

  • Example
    import ops
    def ops_condition(_ops):
        ret, reason = _ops.cli.subscribe("corn1","device",True,True,False,20)
        return ret
    def ops_execute(_ops):
        _ops.terminal.write("Enter your passwd:",None)
        passwrd,ret =,15,None)

    When the front end executes the script, the character string entered by a user on the CLI terminal is output.

Updated: 2019-05-05

Document ID: EDOC1100004147

Views: 59536

Downloads: 28

Average rating:
This Document Applies to these Products

Related Version

Related Documents

Previous Next