Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Rename Objects In Configuration Data Using the Junos XML Protocol

In a Junos XML protocol session with a device running Junos OS, to change the name of one or more of a configuration object’s identifiers, a client application includes the tag elements described in Creating, Modifying, or Deleting Configuration Elements Using the Junos XML Protocol. When using Junos XML tag elements, the client application includes the rename="rename" attribute and an attribute named after the identifier keyword in the object’s opening tag. The value of the attribute is the new identifier value. The application includes the identifier tag element to specify the current name. In the following, the identifier tag element is called <name>:

If the object has multiple identifiers, for each one the application includes both an attribute in the opening tag and an identifier tag element. If one or more of the identifiers is not changing, the attribute value for it is set to its current name. The opening tag appears on two lines for legibility only:

When using configuration mode commands to rename an object, the application specifies the rename command equivalent to the CLI configuration mode command. If the object has multiple identifiers, the application includes a separate rename command for each identifier.

Note:

The rename operation is not available when formatted ASCII text or JSON is used to represent the configuration data.

For Junos XML tag elements the rename attribute can be combined with the inactive or active attribute to deactivate or reactivate the configuration element as it is renamed. For more information, see Changing a Configuration Element’s Activation State Simultaneously with Other Changes Using the Junos XML Protocol.

The following example shows how to change the name of a firewall filter from access-control to new-access-control using Junos XML tag elements. This operation is equivalent to the following configuration mode command:

The following example shows how to change the name of a firewall filter from access-control to new-access-control using configuration mode commands:

The following example shows how to change the identifiers for an OSPF virtual link (defined at the [edit protocols ospf area area] hierarchy level) from neighbor-id 192.168.0.3 and transit-area 10.10.10.1 to neighbor-id 192.168.0.7 and transit-area 10.10.10.5. This operation is equivalent to the following configuration mode command (which appears on two lines for legibility only):

Client Application

Junos XML Protocol Server