Actions
Actions in a policy can notify users of certain events or change the configuration in response to events.
Use the policy command with action add to define the actions in a policy. For example:
(config) # policy alias MapMonitor action add MapDisable param mapAlias map1
Refer to the template for the MapDisable action as follows:
Disabling map <$mapAlias$>.
In the example, the mandatory mapAlias keyword has been specified. Some actions have multiple mandatory keywords.
Use the show action command to view the pre-defined actions and their templates. The command is as follows:
(config) # show action
In the output of the show action command, the Template column displays the parameters that must be specified when defining the action in a policy. The template contains mandatory keywords, for example, <$mapAlias$>. The strings enclosed in dollar signs ($) are parameters that must be specified as part of configuring a policy.
Note: Some actions do not have any parameters, such as WriteMemory.
How to specify Keywords in Actions
The syntax for specifying keywords in actions is described in the following sections:
 Specifying Keyword, mapAlias
Specifying Keyword, mapAlias
                                                                The mandatory keyword, mapAlias, specifies a map alias, for example:
(config) # policy alias p1 action add MapDisable param mapAlias m1
Refer to the template for the MapDisable action as follows:
Disabling map <$mapAlias$>
 Specifying Keyword, policyAlias
Specifying Keyword, policyAlias
                                                                The mandatory keyword, policyAlias, specifies a policy alias, for example:
(config) # policy alias p1 action add PolicyEnable param policyAlias p1
Refer to the template for the PolicyEnable action as follows:
Enabling policy <$policyAlias$>
 Specifying Keyword, portId
Specifying Keyword, portId
                                                                The mandatory keyword, portId, specifies a port identifier. There are several ways to specify ports.
The formats for portId are as follows:
| single port—a/b/c | 
| multiple ports, separated by commas—a1/b1/c1,a2/b2/c2 | 
| range of ports—a/b/c..d | 
The following is an example of a single port. When the port matches, the action is executed.
(config) # policy alias policy1 action add PortEnable param portId 1/1/x1
Refer to the template for the PortEnable action as follows:
Enabling port <$portId$> admin.
The following is an example of multiple ports. When all ports match, the action is executed. In this case, all ports means x1 and x3.
(config) # policy alias policy3 action add PortEnable param portId 1/1/x1,1/1x3
 Specifying Keyword, ruleId
Specifying Keyword, ruleId
                                                                The mandatory keyword, ruleId, specifies a map rule identifier, for example:
(config) # policy alias policy2 action add MapRuleDelete param ruleId 2 param mapAlias map1
In this example, if there were five rule IDs numbered from 1 to 5 and rule ID 2 is removed, the remaining rule IDs will be numbered 1, 3, 4, and 5.
Refer to the template for the MapRuleDelete action as follows:
Remove rule-id <$ruleId$> from map <$mapAlias$>
To obtain rule IDs, use the show map command.
 Specifying Keyword, ruleStr
Specifying Keyword, ruleStr
                                                                The mandatory keyword, ruleStr, specifies a map rule string, for example:
(config) # policy alias AddM1 action add MapRuleAdd param ruleStr "pass vlan 100" param mapAlias m1
Refer to the template for the MapRuleAdd action as follows:
Add a rule <$ruleStr$> to map <$mapAlias$>
Rule strings begin with pass or drop. The rule strings are enclosed in quotation marks.
 Specifying Keyword, inlineNetAlias
Specifying Keyword, inlineNetAlias
                                                                The mandatory keyword, inlineNetAlias, specifies an inline network port alias, for example:
(config) # policy alias p1 action add PhysicalByPassEnable param inlineNetAlias IN1
Refer to the template for the PhysicalByPassEnable action as follows:
Enable Physical Bypass for Inline Network Port <$inlineNetAlias$>
 Specifying Keyword, inlineToolAlias
Specifying Keyword, inlineToolAlias
                                                                The mandatory keyword, inlineToolAlias, specifies an inline tool port alias, for example:
(config) # policy alias p1 action add InlineToolEnable param inlineToolAlias IT1
Refer to the template for the InlineToolEnable action as follows:
Enabling inline tool <$inlineToolAlias$>
 Specifying Keyword, inlineNetTrafficPath
Specifying Keyword, inlineNetTrafficPath
                                                                The mandatory keyword, inlineNetTrafficPath, specifies the traffic path for the inline network, for example:
(config) # policy alias p1 action add InlineNetTrafficPath param inlineNetTrafficPath bypass param inlineNetAlias IN1
Refer to the template for the InlineNetTrafficPath action as follows:
Set Traffic-Path as <$inlineNetTrafficPath$> for Inline network <$inlineNetAlias$>
 Specifying Keyword, oobFromAlias
Specifying Keyword, oobFromAlias
                                                                The mandatory keyword, oobFromAlias, specifies an inline network alias to add or remove out-of-band copy for flexinline map, for example:
(config) # policy alias AddM1 action add FlexInlineOOBDelete param mapAlias flexmap1 param oobFromAlias IN1
Refer to the template for the FlexInlineOOBDelete action as follows:
Remove OOBCopy for map <$mapAlias$> from Inline network <$oobFromAlias$>
 Specifying Keyword, oobDir
Specifying Keyword, oobDir
                                                                The mandatory keyword, oobDir, specifies the direction of traffic when you add or remove out-of-band copy for flexinline map, for example:
(config) # policy alias AddM1 action add FlexInlineOOBAddWithDir param mapAlias flexmap1 param oobFromAlias IN1 param oobDir a-to-b param portId 20/3/q4
Refer to the template for the FlexInlineOOBAddWithDir action as follows:
Create OOBCopy for map <$mapAlias$> from <$oobFromAlias$> for direction <$oobDir$> to OOBTool <$portId$>
 Specifying Keyword, oobTag
Specifying Keyword, oobTag
                                                                The mandatory keyword, oobTag, specifies the tag for out-of-band tool port, for example:
(config) # policy alias AddM1 action add FlexInlineOOBAddWithDirTag param mapAlias flexmap1 param oobFromAlias IN1 param oobDir a-to-b param oobTag as-inline param portId 20/3/q5
Refer to the template for the FlexInlineOOBAddWithDirTag action as follows:
Create OOBCopy for map <$mapAlias$> from <$oobFromAlias$> for direction <$oobDir$> to OOBTool <$portId$> with tag <$oobTag$>
Related Topics
Also, refer to the following sections:
 Map Enable and Disable
Map Enable and Disable
                                                                Refer to map.
 Known Behaviors
Known Behaviors
                                                                The following are known behaviors:
| Events are evaluated sequentially. Actions are executed sequentially. | 
| If an unsupported map type is specified in an action, the output of the show policy command displays Action error! | 
| If an alias or port ID does not exist, the following error is displayed: Invalid param value. | 
 Actions in Policies
Actions in Policies
                                                                For the usage of actions in policies, refer to Policies.



