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

RESTful API Reference

CloudEngine 8800, 7800, 6800, and 5800 V200R002C50

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).
Log Recording

Log Recording

  • Function Description

    The OPS's embedded running environment provides syslog functions. When scripts are running on a device, some information is recorded in the device's log.

  • Command Prototype

    opsObj.syslog(content, severity="informational", logtype="syslog")

  • Parameter Description
    Table 3-850  Parameters supported by syslog

    Method

    Description

    opsObj

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

    content

    Specifies log content, which supports a maximum of 512 bytes. If the content length exceeds 512 bytes, information fails to be recorded in the log.

    severity

    Specifies a log level, which can be criticalerrorwarning, or informational (in descending order). The default level is informational.

    logtype

    Specifies a log type, which can be syslog or diagnose. If syslog is specified, information is recorded in the syslog. After a syslog server is configured, the syslog is uploaded to the syslog server. If diagnose is specified, information is recorded in the diagnostic log. The default value is syslog.

  • 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.

  • Example
    test.py
    improt ops
    opsObj = ops.ops()
    opsObj.syslog("Record an informational syslog.")

    After the script is run, information is recorded in the syslog.

Translation
Download
Updated: 2019-03-21

Document ID: EDOC1000166567

Views: 18037

Downloads: 116

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