Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation

apply-macro

Syntax

apply-macro apply-macro-name {parameter-name parameter-value;}

Hierarchy Level

All hierarchy levels

Release Information

Statement introduced in Junos OS Release 7.4.

Statement introduced in Junos OS Release 12.2 for the QFX Series.

Description

With commit script macros, use custom syntax in your configuration.

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.

Options

apply-macro-name

Name of the apply-macro statement.

parameter-name

One or more parameters. Parameters can be any text you want to include in your configuration.

parameter-value

A value that corresponds to the parameter name. Parameter values can be any text you want to include in your configuration.

Required Privilege Level

configure—To enter configuration mode; other required privilege levels depend on where the statement is located in the configuration hierarchy.

Published: 2014-07-23