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

Command Reference

CloudEngine 8800, 7800, 6800, and 5800 V200R002C50

This document describes all the configuration commands of the device, including the command function, syntax, parameters, views, default level, usage guidelines, examples, and related commands.
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).
OPS Commands

OPS Commands

display ops environment

Function

The display ops environment command displays user-defined environment variables.

Format

display ops environment

Parameters

None

Views

All views

Default Level

3: Management level

Usage Guidelines

The OPS supports the following environment variables:
  • System environment variables: environment variables that are automatically generated during system running. The name of a system environment variable begins with an underscore (_).

  • User environment variables: environment variables that are configured using the environment command.

To view user-defined environment variables, run the display ops environment command.

Example

# Display user-defined environment variables.

<HUAWEI> display ops environment
---------------------------------------------------------------------------------
No.  Name                            Value
---------------------------------------------------------------------------------
1    userdefine                      1
---------------------------------------------------------------------------------
Table 5-94  Description of the display ops environment command output

Item

Description

No.

Number of the environment variable

Name

Name of the environment variable

Value

Value of the environment variable

Related Topics

display ops process

Function

The display ops process command displays information about OPS tasks.

Format

display ops process { history | current | verbose }

Parameters

Parameter Description Value
history Displays historical records of OPS tasks. -
current Displays brief information about the running OPS task. -
verbose Displays detailed information about the running OPS task. -

Views

All views

Default Level

3: Management level

Usage Guidelines

You can use this command to check information about historical OPS tasks or the running OPS task, including the task ID and running status. The command can display a maximum of 100 latest OPS task records.

Example

# Display brief information about the running OPS task.

<HUAWEI> display ops process current
--------------------------------------------------------------------------------
ID      ProcessName      State       Command
--------------------------------------------------------------------------------
4       81               running     test.py
--------------------------------------------------------------------------------
Table 5-95  Description of the display ops process current command output

Item

Description

ID

Task ID.

ProcessName

Task name.

State

Current status of the task. The value can be:
  • running: The task is running.
  • suspend: The task is suspended.
  • pending: The task is waiting to run.
Command Name of the script that the task executes.

# Display detailed information about the running OPS task.

<HUAWEI> display ops process verbose
Command           : test.py
ID                : 4
ProcessName       : 81
Owner type        : user
Owner name        :
Background flag   : false               
Trigger time      : 2013-12-26 07:10:43
Start time        : 2013-12-26 07:10:43
State             : running
Table 5-96  Description of the display ops process verbose command output

Item

Description

Command

Script name.

ID

Task ID.

ProcessName

Task name.

Owner type Type of the owner that triggers the task. The value can be:
  • user: The task is triggered by a user.
  • assistant: The task is an assistant.
Owner name Name of the task owner.
Background flag Whether the task is executed on the background. The value can be:
  • false: The task is not executed on the background.

  • true: The task is executed on the background.

Trigger time Time when the task is triggered.
Start time Start time of the task.
State
Current status of the task. The value can be:
  • running: The task is running.
  • suspend: The task is suspended.
  • pending: The task is waiting to run.
Related Topics

display ops running context

Function

The display ops running context command displays information about system environment variables.

Format

display ops running context [ history ]

Parameters

Parameter Description Value
history Displays information about historical system environment variables. -

Views

All views

Default Level

3: Management level

Usage Guidelines

The OPS supports the following environment variables:
  • System environment variables: environment variables that are automatically generated during system running. The name of a system environment variable begins with an underscore (_).

  • User environment variables: environment variables that are configured using the environment command.

To view information about current or historical system environment variables, run the display ops running context command.

Example

# Display information about current system environment variables.

<HUAWEI> display ops running context
--------------------------------------------------------------------------------------------
Creator                        Variable                       Value
--------------------------------------------------------------------------------------------
_ops_frame_execute.py          ai                             1
--------------------------------------------------------------------------------------------
Table 5-97  Description of the display ops running context command output

Item

Description

Creator

Script of the environment variable

Variable

Name of the environment variable

Value

Value of the environment variable

display ops script

Function

The display ops script command displays directory information about OPS scripts.

Format

display ops script [ dir-or-file-name ]

Parameters

Parameter Description Value
dir-or-file-name Specifies a script file name or directory.

The value is a string of 1 to 127 characters without spaces. The file-name must already exist. The default path is flash:/$_user/.

Views

All views

Default Level

3: Management level

Usage Guidelines

You can use this command to check directory information about scripts installed on the device, including the file name and installation directory.

Example

# Display directory information about installed OPS scripts.

<HUAWEI> display ops script
--------------------------------------------------------------------------------
  Index      Size(Byte)  Filename
--------------------------------------------------------------------------------
      0            4310  OPS_display_startup.py                                 
      1            6283  info/OPS_get_systeminfo.py
--------------------------------------------------------------------------------
Table 5-98  Description of the display ops script command output

Item

Description

Index

Index of a script.

Size(Byte)

Size of a script.

Filename

File name or directory of a script.

Related Topics

environment

Function

The environment command configures an environment variable.

The undo environment command deletes a configured environment variable.

By default, no environment variable is configured.

Format

environment env-name env-value

undo environment env-name

Parameters

Parameter Description Value
env-name

Specifies the name of an environment variable.

The value is a string of 1 to 31 case-sensitive characters. The string can contain only letters, digits, and underscores (_) and must start with letters.

env-value

Specifies the value of an environment variable.

The value is a string of 1 to 256 case-sensitive characters, spaces not supported.

When double quotation marks are used around the string, spaces are allowed in the string.

Views

OPS view

Default Level

3: Management level

Usage Guidelines

The OPS supports the following environment variables:
  • System environment variables: environment variables that are automatically generated during system running.

  • User environment variables: environment variables that are configured using the environment command.

Intermediate data generated during Python script running is lost after the Python is shut down. You can run the environment command to configure the Python script's running variable as an environment variable so that data is saved or used by other users.

Example

# Configure an environment variable named userdefine and set its value to test.

<HUAWEI> system-view
[~HUAWEI] ops
[~HUAWEI-ops] environment userdefine test

ops

Function

The ops command displays the OPS view.

Format

ops

Parameters

None

Views

System view

Default Level

3: Management level

Usage Guidelines

You can configure assistants in the OPS view.

Example

# Enter the OPS view.

<HUAWEI> system-view
[~HUAWEI] ops 
[~HUAWEI-ops]

ops install file

Function

The ops install file command installs a script or batch file on a device.

By default, no script or batch file is installed on a device.

Format

ops install file file [ destination directory ]

Parameters

Parameter Description Value
file Specifies the path and file name of a script or batch file to be installed.

The value is a string of 1 to 127 characters without spaces. The default directory is flash:/.

destination directory Specifies the directory where the script or batch file will be installed.

The value is a string of 1 to 127 characters without spaces.

The default installation path is flash:/$_user/. If directory is not specified, the script or batch file is installed in flash:/$_user/. If directory is specified, the script or batch file is installed in flash:/$_user/directory/.

Views

User view

Default Level

3: Management level

Usage Guidelines

Usage Scenario

Before manually running a script or binding a script or batch file to an assistant, you must install script or batch file on the device.

Precautions

  • If the specified directory does not exist, the system automatically creates the directory. A maximum of seven levels of subdirectories can be created under flash:/$_user/.

  • To reinstall a script, run the ops uninstall file command to uninstall the script first.

  • It is recommended that the total size of files installed in flash:/$_user/ be smaller than 100 MB. If the total file size exceeds 100 MB, performance of data synchronization between the active and standby MPUs may deteriorate.

Example

# Install the script config.py to the default directory.

<HUAWEI> ops install file config.py

ops run python

Function

The ops run python command runs a Python script.

Format

ops run python [ background ] file-name [ arguments ]

Parameters

Parameter Description Value
background

Runs a script on the background.

If this keyword is not specified, the script runs on the foreground.

-

file-name

Specifies the path and file name of a Python script.

The value is a string of 1 to 127 characters without spaces. The file-name must already exist. The default path is flash:/$_user/.

The file name extension of a Python script must be .py.

arguments

Specifies the parameter used for script execution. The parameter is parsed by the script.

The value contains 1 to 383 characters, in text format.

Views

User view

Default Level

3: Management level

Usage Guidelines

Usage Scenario

After making a Python script for a certain function, you can use this command to manually run the script.

You can manually run a script on the foreground or background:
  • Foreground: If the script runs on the foreground, you can see information generated during script execution and enter information in interactive mode. The information you enter is transparently transmitted to the script, and the OPS does not check whether the interaction times out.

    You can stop the script by pressing Ctrl+C. If the script is configured to ignore the Ctrl+C operation, it continues running.

  • Background: All information generated during script execution is shielded, and all information you enter is sent to the script as null strings.

Prerequisites

The Python script has been uploaded to the device and installed using the ops install file command in the user view.

Precautions

  • If you close the current window while the Python script is running on the foreground, the script stops running.

  • A maximum of 10 scripts can be executed manually at the same time.

Example

# Run the script config.py.

<HUAWEI> ops install file config.py
<HUAWEI> ops run python config.py

ops stop process

Function

The ops stop process command stops a running OPS task.

Format

ops stop process process-id

Parameters

Parameter Description Value
process-id Specifies a task ID.

The value is an integer that ranges from 0 to 4294967295.

Task IDs are assigned by the system. To stop a running task, run the display ops process current command to obtain the ID of the running OPS task.

Views

User view

Default Level

3: Management level

Usage Guidelines

Usage Scenario

You can use the ops stop process to stop a running OPS task.

Precautions

After you stop a task, the script or batch file bound to the task will no longer be executed. Exercise caution when you run this command.

Example

# Stop the running task 2002.

<HUAWEI> ops stop process 2002

ops uninstall file

Function

The ops uninstall file command uninstalls a script or batch file.

Format

ops uninstall file file-name-or-dir

Parameters

Parameter Description Value
file-name-or-dir Specifies the file name or directory of a script or batch file to be uninstalled.

The value is a string of 1 to 127 characters without spaces. The file-name must already exist. The default path is flash:/$_user/.

Views

User view

Default Level

3: Management level

Usage Guidelines

Usage Scenario

You can uninstall unnecessary scripts or batch files to release storage space on a device. If an installed script or batch file needs to be updated, uninstall it first and reinstall it after the modification.

Precautions

  • If a file name is specified, the command uninstalls the specified file. If a directory is specified, the command uninstalls all files in the directory and its subdirectories.

  • This command cannot uninstall a script that has been bound to an assistant. To uninstall the script, unbind it from assistant first.

  • If the script bound to an assistant calls other scripts, the called scripts can be uninstalled using this command. Therefore, it is recommended that you use one script to implement required functions.

Example

# Uninstall the script config.py.

<HUAWEI> ops uninstall file config.py
Translation
Download
Updated: 2019-03-21

Document ID: EDOC1000166501

Views: 69493

Downloads: 374

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