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

S2720, S5700, and S6720 V200R013C00

This document describes the configurations of Device Management, including device status query, hardware management, Stack, SVF, cloud-based management, PoE, monitoring interface, OPS, 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).
(Optional) Configuring the User-defined Environment Variable

(Optional) Configuring the User-defined Environment Variable

Context

An environment variable consists of a name and a value. In a Python script, you can input an environment variable name in the location where a parameter needs to be input to indicate that an environment variable value needs to be referenced. When the system is running a Python script, it replaces an environment variable name with an environment variable value. To change the value, you can directly change it on the device without having to change and install the Python script. You can define and use user-defined environment variables to simplify the configuration and improve flexibility and feasibility of the Python script.

User-define environment variables start with letters, can contain letters, digits, and _, apply to all types of events, and can be used in subscription and execution phases. The value of a user-defined environment variable can be configured using the environment command. You can create, modify, and delete user-defined variables.

For example, a user wants to subscribe to changes of OSPF routes on the network segment 10.2.1.0/24 in the Python script, and then needs to subscribe to changes of OSPF routes on the network segment 10.2.2.0/24. To omit the process of uninstalling the original script and installing a new script, you can define an environment variable in the subscription phase, and specify the value of the environment variable using the environment command.

If you use a user-defined environment variable in the Python script, you need to set the value of the user-defined environment variable.

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run ops

    The OPS view is displayed.

  3. Run environment variable-name variable-value

    The user-defined environment variable is configured.

    By default, no user-defined environment variable is configured.

    A maximum of 100 user-defined environment variables can be supported on a device.

Translation
Download
Updated: 2019-04-20

Document ID: EDOC1100065674

Views: 44486

Downloads: 374

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