apply-macro
Syntax
apply-macroapply-macro-name{param-nameparam-value;}Hierarchy Level
Release Information
Statement introduced in JUNOS Release 7.4.
Description
With commit script macros, use custom syntax in your configuration.
Macros work by locating
apply-macrostatements that you include in the candidate configuration and using the values specified in theapply-macrostatement as parameters to a set of instructions (the macro) defined in a commit script. The commit script alters your configuration from one that contains non-JUNOS custom syntax into a full configuration containing standard JUNOS statements.In effect, your custom configuration syntax serves a dual purpose. The syntax allows you to simplify your configuration tasks, and it provides data (or hooks) that are used by a commit script macros.
You can include the
apply-macrostatement at any level of the configuration hierarchy. You can include multipleapply-macrostatements at each level of the configuration hierarchy; however, each must have a unique name.Options
apply-macro-name—Name of theapply-macrostatement.
param-name—One or more parameters. Parameters can be any text you want to include in your configuration.
param-value—A value that corresponds to the parameter name. Parameter values can be any text you want to include in your configuration.Usage Guidelines
See Creating Custom Configuration Syntax with Macros.
Required Privilege Level
configure—To enter configuration mode; other required privilege levels depend on where the statement is located in the configuration hierarchy.