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).
Returning Event Execution Results

Returning Event Execution Results

Interface Name

Returning event execution results

Application Phase

Execution phase of resident scripts

API Prototype

result1_value, result2_description = ops.result(status)

Description

Parameter

Description

Value

status

Indicates the user script execution result.

The value 0 indicates that the user script is executed successfully, and the value 1 indicates that the user script fails to be executed.

Return Value

The result1_value and result2_description in the API prototype indicate return values.

The first return value 0 indicates that an event is executed successfully, and the first return value 1 indicates that an event fails to be executed.

The second return value is a string of characters indicating the results.

Usage Description

This API indicates the event execution result. The value 0 indicates that an event is executed successfully, and the value 1 indicates that an event fails to be executed. If the result function is invoked for multiple times, the value returned by the first result function takes effect.

Example

When a subscription event is matched, the device reads the content entered on a user terminal, and returns the execution result based on the content.

value, err_str = ops.terminal.read(512 ,30, vty=None) # Read the user input from the current user terminal.
print("\r\no.terminal.read.value1:", value)
print("\r\no.terminal.read:", err_str)
#If the user enters YES, 1 is returned. If the user enters no or other information, 0 is returned.
if value == "yes":
	print(value)
if value == "no":
	ops.result(0)
ops.result(0)
Translation
Download
Updated: 2018-09-03

Document ID: EDOC1100038289

Views: 43785

Downloads: 15

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