[Contents] [Prev] [Next] [Index] [Report an Error]

Creating, Modifying, or Deleting Configuration Elements

In addition to replacing the entire configuration (as described in Replacing the Entire Configuration), a client application can create, modify, or delete one or more configuration elements (hierarchy levels and configuration objects) in the candidate configuration or a private copy.

To use JUNOS XML tag elements to represent an element, the application includes the tag elements representing all levels in the configuration hierarchy from the root (represented by the <configuration> tag element) down to the element’s container tag element. Which attributes and child tag elements are included depends on the operation being performed on the element. The syntax applies both to the contents of a file and to a data stream. In the following, the identifier tag element is called <name>:

<configuration>
<!- - opening tag for each parent of the element - ->
<container-tag [operation-attribute="value"]>
<name>identifier</name> <!- - if the element has an identifier - ->
<!- - other child tag elements - -> <!- - if appropriate for the operation - ->
</container-tag>
    <!- - closing tag for each parent of the element - ->
</configuration>

To use formatted ASCII text to represent an element, the application includes the complete statement path, starting with a statement that can appear directly under the [edit] hierarchy level. The attributes and child statements to include depend on the operation being performed on the element. The set of statements is enclosed in a <configuration-text> tag element when the application provides a data stream. When saving statements to a file for later loading, omit the <configuration-text> tag element.

<configuration-text>
/* statements for parent levels of the element */
operation-to-perform: # if appropriate
element identifier   { # if the element has an identifier
/* child statements */  # if appropriate for the operation
}
/* closing braces for parent levels for the element */
</configuration-text>

When loading formatted ASCII text, the application includes the format=”text" attribute in the <load-configuration/> tag or opening <load-configuration> tag.

For more information about the source and formatting for configuration elements, see Specifying the Source and Format of New Configuration Data.

For information about the operations a client application can perform on configuration elements, see the following sections:


[Contents] [Prev] [Next] [Index] [Report an Error]