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).
Restoring Script Variable

Restoring Script Variable

Interface Name

Restoring script variable

Application Phase

Subscription and execution phases

API Prototype

result1_value, result2_description = ops.context.retrieve(varName)

Description

Parameter

Description

Value

varName

Indicates a variable name.

The value is specified in the saving script variable API.

Return Value

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

The first value is None if the specified variable fails to be restored. If the variable is restored successfully, the first value is the specified variable.

The second return value is the failure cause when the first return value is None.

Usage Description

You can use this API in scripts to restore values of script variables in context. After the value is restored, the saved value is deleted.

The restoring script variable API and saving script variable API are used together to transmit script variables between contexts.

Example

Read user input from a terminal, use the script variable input1 to save the user input, and then restore the value of the script variable input1.

value1, descri_str1 = ops.terminal.read(512, timeout=30, vty=None)
value2, descri_str2 = ops.context.save("input1", value1)
value3, descri_str3 = ops.context.retrieve("input1")
Translation
Download
Updated: 2018-09-03

Document ID: EDOC1100038289

Views: 42580

Downloads: 15

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