rule command(Task group view)

Function

The rule command command creates a rule in a task group to allow a command or multiple commands to be executed in a specific view.

The undo rule command command cancels the configuration.

By default, no rule is configured in a task group.

Format

rule command rule-name permit view view-name expression command-string

undo rule command rule-name

Parameters

Parameter Description Value
rule-name

Specifies the name of a rule.

The value is a string of 1 to 15 case-insensitive characters.

permit

Allows a command to be executed in a specific view.

-

view view-name

Specifies the name of a view.

The value can be any view supported by the system.

expression command-string

Specifies a command or a batch of commands with the same prefix.

The value can be any command supported by the system.The value is a string of 1 to 1604 characters.

Views

Task group view

Default Level

3: Management level

Task Name and Operations

Task Name Operations
aaa write

Usage Guidelines

Usage Scenario

To provide granular management and flexible configuration and allow a command or a batch of commands with the same prefix to be executed in a view, run the rule command command.In the same task group, the priority of the rule command command is higher than that of the task command. When the rule command command configuration conflicts with the task command configuration, the rule command command configuration takes effect preferentially.

Precautions

In the same task group, two rules with the same view and keyword cannot be configured. For example, if the sysname command is allowed to be executed in the system view in rule 1, the sysname command cannot be configured in a second rule.

If the rule command command is run several times, the latest configuration overrides the previous one.

Example

# Create a rule in the task group named group1 to allow the sysname command to be executed in the system view.
<HUAWEI> system-view
[~HUAWEI] aaa
[~HUAWEI-aaa] task-group group1
[*HUAWEI-aaa-task-group-group1] rule command command1 permit view system expression sysname
# Create a rule in task group to allow all the commands starting with hwtacacs to be executed in the system view.
<HUAWEI> system-view
[~HUAWEI] aaa
[~HUAWEI-aaa] task-group group1
[*HUAWEI-aaa-task-group-group1] rule command command2 permit view system expression hwtacacs
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >