All hierarchy levels
Statement introduced in Junos OS Release 7.4.
Statement introduced in Junos OS Release 12.2 for the QFX Series.
Statement introduced in Junos OS Release 14.1X53-D20 for the OCX Series.
Use custom syntax in your configuration, which is expanded into standard Junos OS configuration statements during the commit process using the instructions defined in the corresponding commit script macro.
Macros work by locating apply-macro statements that you include in the candidate configuration and using the values specified in the apply-macro statement as parameters to a set of instructions (the macro) defined in a commit script. The commit script alters your configuration from one that contains custom syntax into a full configuration containing standard Junos OS 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 commit script macros.
You can include the apply-macro statement at any level of the configuration hierarchy. You can include multiple apply-macro statements at each level of the configuration hierarchy; however, each must have a unique name.
Required Privilege Level
configure—To enter configuration mode; other required privilege levels depend on where the statement is located in the configuration hierarchy.