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).
Support Resident Scripts

Support Resident Scripts

  • Function Description

    The OPS ERE supports resident scripts. When a resident script is executed, ops.result() returns the execution result, and ops.wait() suspends the script. After the script is triggered again, ops.wait() is returned, and script execution continues.

  • Command Prototype



  • Parameter Description
    Table 3-917  Parameters supported by resident script APIs




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


    Specifies a return value, indicating the script processing result sent to the OPS. The value 0 indicates a success (The original command is skipped.). Other values are error codes.

  • Description of Return Values


  • Example
    import ops
    def ops_condition(_ops):
    return ret
    def ops_execute(_ops):
    a, des="wait1", 'ac1')
    a, des="wait2", 'ac2')
    return 0

    The opsObj.result() function returns the script processing result to the OPS. The result can also be returned using return. If neither opsObj.result() nor return is used, the default value 1 is returned. If both opsObj.result() and return are used, the result returned by opsObj.result() takes effect. If opsObj.result() is called consecutively, the first result takes effect.

    opsObj.wait() indicates that script execution continues after the next event occurs. The opsObj.result() function returns the script processing result and suspends the script until the next event occurs. This implements resident script processing.

Updated: 2019-05-05

Document ID: EDOC1100004147

Views: 59587

Downloads: 28

Average rating:
This Document Applies to these Products

Related Version

Related Documents

Previous Next