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

A Junos XML protocol client application can rename configuration objects on Junos devices.

A Junos XML protocol client application can change the name of one or more of a configuration object’s identifiers. To rename the object, a client application first includes the tag elements described in Create, Modify, or Delete Configuration Elements Using the Junos XML Protocol.

To use Junos XML elements to rename an object, the client application includes the object and its identifier element with the current name. In the object's opening tag, the application includes:

  • The rename="rename" attribute.

  • An attribute with the same name as the identifier tag name. For most objects, this is name. The value for this attribute is the new identifier for the object.

If the object has multiple identifiers, the application includes both an identifier element and an attribute in the opening tag for each one. If one or more of the identifiers is not changing, set its attribute value to its current name. For example:

To use 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:

You cannot use the rename operation when you use formatted ASCII text or JSON to represent the configuration data.

The following example changes the name of a firewall filter from access-control to new-access-control using Junos XML elements.

The operation is equivalent to the following configuration mode command:

The following example changes 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.