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).
Display Messages on User Terminals

Display Messages on User Terminals

  • Function Description

    The OPS provides an interface for displaying messages 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

    opsObj.terminal.write(msg, vty=None)

  • Parameter Description
    Table 3-911  Parameters supported by APIs displaying messages on user terminals




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


    Specifies a character string to be displayed on user terminals.


    Specifies a user terminal. Currently, messages can only be displayed 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

    First return value: The value 0 indicates a success; the value 1 indicates a failure.

    Second return value: This value describes success or failure reasons, expressed in character strings.

  • 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("Hello world!",None)
        return 1

    When the front end executes the script, the Python script outputs "Hello World!" to the CLI terminal.

Updated: 2019-05-05

Document ID: EDOC1100004147

Views: 60078

Downloads: 28

Average rating:
This Document Applies to these Products

Related Version

Related Documents

Previous Next