- play_arrow Overview
- play_arrow NETCONF XML Management Protocol Overview
- play_arrow NETCONF and Junos XML Tags Overview
- XML and Junos OS Overview
- XML Overview
- XML and NETCONF XML Management Protocol Conventions Overview
- Map Junos OS Commands and Command Output to Junos XML Tag Elements
- Map Configuration Statements to Junos XML Tag Elements
- Using NETCONF Configuration Response Tag Elements in NETCONF Requests and Configuration Changes
-
- play_arrow Manage NETCONF Sessions
- play_arrow NETCONF Session Overview
- play_arrow Manage NETCONF Sessions
- Establish an SSH Connection for a NETCONF Session
- NETCONF Sessions over Transport Layer Security (TLS)
- NETCONF and Shell Sessions over Enhanced Outbound HTTPS
- NETCONF Sessions over Outbound HTTPS
- NETCONF Call Home Sessions
- NETCONF Sessions
- Sample NETCONF Session
- How Character Encoding Works on Juniper Networks Devices
- Configure RFC-Compliant NETCONF Sessions
- NETCONF Monitoring
- NETCONF Event Notifications
- play_arrow NETCONF Tracing Operations
- play_arrow NETCONF Protocol Operations and Attributes
- play_arrow NETCONF Request and Response Tags
- play_arrow Junos XML Protocol Elements Supported in NETCONF Sessions
- <abort/>
- <abort-acknowledgement/>
- <checksum-information>
- <close-configuration/>
- <commit-configuration>
- <commit-results>
- <commit-revision-information>
- <database-status>
- <database-status-information>
- <end-session/>
- <get-checksum-information>
- <get-configuration>
- <load-configuration>
- <load-configuration-results>
- <lock-configuration/>
- <open-configuration>
- <reason>
- <request-end-session/>
- <routing-engine>
- <unlock-configuration/>
- <xnm:error>
- <xnm:warning>
- play_arrow Junos XML Protocol Element Attributes Supported in NETCONF Sessions
-
- play_arrow Request Operational and Configuration Information Using NETCONF
- play_arrow Request Operational Information Using NETCONF
- play_arrow Request Configuration Information Using NETCONF
- Request the Committed Configuration and Device State Using NETCONF
- Request Configuration Data Using NETCONF
- Specify the Source for Configuration Information Requests Using NETCONF
- Specify the Scope of Configuration Information to Return in a NETCONF Response
- Request the Complete Configuration Using NETCONF
- Request a Configuration Hierarchy Level or Container Object Without an Identifier Using NETCONF
- Request All Configuration Objects of a Specified Type Using NETCONF
- Request Identifiers for Configuration Objects of a Specified Type Using NETCONF
- Request A Specific Configuration Object Using NETCONF
- Request Specific Child Tags for a Configuration Object Using NETCONF
- Request Multiple Configuration Elements Simultaneously Using NETCONF
- Retrieve a Previous (Rollback) Configuration Using NETCONF
- Compare Two Previous (Rollback) Configurations Using NETCONF
- Retrieve the Rescue Configuration Using NETCONF
- Request an XML Schema for the Configuration Hierarchy Using NETCONF
-
- play_arrow NETCONF Utilities
- play_arrow NETCONF Perl Client
- play_arrow Develop NETCONF Perl Client Applications
- Write NETCONF Perl Client Applications
- Import Perl Modules and Declare Constants in NETCONF Perl Client Applications
- Connect to the NETCONF Server in Perl Client Applications
- Collect Parameters Interactively in NETCONF Perl Client Applications
- Submit a Request to the NETCONF Server in Perl Client Applications
- Example: Request an Inventory of Hardware Components Using a NETCONF Perl Client Application
- Example: Change the Configuration Using a NETCONF Perl Client Application
- Parse the NETCONF Server Response in Perl Client Applications
- Close the Connection to the NETCONF Server in Perl Client Applications
-
- play_arrow YANG
- play_arrow YANG Overview
- Understanding YANG on Devices Running Junos OS
- Understanding Junos YANG Modules
- YANG Modules Overview
- Understanding the YANG Modules That Define the Junos OS Configuration
- Understanding the YANG Modules for Junos Operational Commands
- Junos Genstate YANG Data Models
- Understanding the Junos DDL Extensions YANG Module
- YANG Metadata Annotations for Junos Devices
- Use Juniper Networks YANG Modules
- play_arrow Create and Use Non-Native YANG Modules
- Understanding the Management of Nonnative YANG Modules on Devices Running Junos OS
- Manage YANG Packages, Modules, and Scripts on Junos Devices
- Managing YANG Packages and Configurations During a Software Upgrade or Downgrade
- Create Translation Scripts for YANG Configuration Models
- Disable and Enable YANG Translation Scripts on Devices Running Junos OS
- Commit and Display Configuration Data for Nonnative YANG Modules
- Create Custom RPCs in YANG for Devices Running Junos OS
- Create Action Scripts for YANG RPCs on Junos Devices
- Use Custom YANG RPCs on Devices Running Junos OS
- Example: Use a Custom YANG RPC to Retrieve Operational Information on Junos Devices
- Understanding Junos OS YANG Extensions for Formatting RPC Output
- Customize YANG RPC Output on Devices Running Junos OS
- Define Different Levels of Output in Custom YANG RPCs for Junos Devices
- Display Valid Command Option and Configuration Statement Values in the CLI for Custom YANG Modules
- Configure a NETCONF Proxy Telemetry Sensor in Junos
-
- play_arrow OpenDaylight Integration
- play_arrow Configure OpenDaylight Integration
-
- play_arrow Configuration Statements and Operational Commands
Delete Configuration Elements Using NETCONF
Delete configuration elements
You can use NETCONF to delete configuration elements, including hierarchy levels or
configuration objects, from the Junos configuration. You can delete objects from the
candidate configuration or the open configuration database (if the client application
issued the Junos XML protocol <open-configuration>
operation
prior to executing the <edit-config>
operation).
To delete an element, a client application emits the basic tag elements described in
Change Individual Configuration Elements Using NETCONF.
It also emits the <default-operation>
tag element with the value
none
to change the default mode to no-change
.
<rpc> <edit-config> <target> <candidate/> </target> <default-operation>none</default-operation> <!-- EITHER --> <config> <configuration> <!-- tag elements representing the configuration elements to delete --> </configuration> </config> <!-- OR --> <url> <!-- location specifier for file containing elements to delete --> </url> </edit-config> </rpc> ]]>]]>
In no-change mode, existing configuration elements remain unchanged unless the
corresponding element in the new configuration has the
operation="delete"
attribute or operation="remove"
attribute in its opening tag. This mode prevents the NETCONF server from creating parent
hierarchy levels for an element that is being deleted. We recommend that client
applications only perform deletion operations when using no-change mode. When merging,
replacing, or creating configuration elements, client applications use merge mode.
The delete
and remove
attributes both instruct the
NETCONF server to delete the specified configuration element in the target
configuration. However, the NETCONF server behaves differently for each attribute when
the specified configuration element does not exist. If you use the
remove
attribute and the element does not exist, the server
silently ignores the request. If you use the delete
attribute and the
element does not exist, the server returns an <rpc-error>
element
with an <error-tag>
value of data-missing
. We
recommend that you use the remove
attribute when you want to delete an
element but are unsure if the element exists.
To represent each configuration element being deleted (either within the
<config>
tag element or in the file named by the
<url>
tag element), the application emits the tag elements
representing its parent hierarchy levels, as described in Change Individual Configuration Elements Using NETCONF. The
placement of the operation="delete"
attribute or
operation="remove"
attribute depends on the element type, as
described in the following sections.
Deleting a Hierarchy Level or Container Object
To delete a hierarchy level and all of its children (or a container object
that has children but no identifier), a client application includes the
operation="delete"
attribute or the
operation="remove"
attribute in the empty tag that
represents the
level.
<configuration> <!-- opening tags for each parent level --> <level-to-delete operation="(delete | remove)"/> <!-- closing tags for each parent level --> </configuration>
We
recommend that the application set the default mode to no-change by including
the <default-operation>
tag element with the value
none
, as described in Set the Edit Configuration Mode in a NETCONF Session. For more information about hierarchy levels and container objects, see Map Configuration Statements to Junos XML Tag Elements.
The following example shows how to remove the
[edit protocols ospf]
hierarchy level of the candidate
configuration:

Deleting a Configuration Object That Has an Identifier
To delete a configuration object that has an identifier, a client
application includes the operation="delete"
attribute or the
operation="remove"
attribute in the container tag element
for the object. Inside the container tag element, it includes the identifier tag
element only, not any tag elements that represent other characteristics. In the
following, the identifier tag element is
called <name>
:
<configuration> <!-- opening tags for each parent of the object --> <object operation="(delete | remove)"> <name>identifier</name> </object> <!-- closing tags for each parent of the object --> </configuration>
The delete
or remove
attribute appears in
the opening container tag, not in the identifier tag element. You include
the identifier tag element to delete the specified object, not the entire
hierarchy level represented by the container tag.
We recommend that the application set the default mode to no-change by
including the <default-operation>
tag element with the
value none
, as described in Set the Edit Configuration Mode in a NETCONF Session. For more information about identifiers, see Map Configuration Statements to Junos XML Tag Elements.
The following example shows how to remove the user object
barbara
from the [edit system login user]
hierarchy level in the candidate configuration:

Deleting a Single-Value or Fixed-Form Option from a Configuration Object
To delete either a fixed-form option or an option that takes just one value
from a configuration object, a client application includes the
operation="delete"
attribute or the
operation="remove"
attribute in the tag element for the
option. In the following example, the identifier tag element for the object is
called <name>
. (For information about deleting an option
that can take multiple values, see Deleting Values from a Multi-value Option of a Configuration Object.)
<configuration> <!-- opening tags for each parent of the object --> <object> <name>identifier</name> <!-- if object has an identifier --> <option1 operation="(delete | remove)"> <option2 operation="(delete | remove)"> <!-- tag elements for other options to delete --> </object> <!-- closing tags for each parent of the object --> </configuration>
We
recommend that the application set the default mode to no-change by including
the <default-operation>
tag element with the value
none
, as described in Set the Edit Configuration Mode in a NETCONF Session. For more information about options, see Map Configuration Statements to Junos XML Tag Elements.
The following example shows how to remove the fixed-form option
disable
at the
[edit forwarding-options sampling]
hierarchy
level:

Deleting Values from a Multi-value Option of a Configuration Object
As described in Map Configuration Statements to Junos XML Tag Elements, some Junos OS configuration objects are leaf statements that have multiple values. In the formatted ASCII CLI representation, the values are enclosed in square brackets following the name of the object:
object [value1 value2 value3 ...];
The
Junos XML representation does not use a parent tag for the object, but instead
uses a separate instance of the object tag element for each value. In the
following example, the identifier tag element is called
<name>
:
<parent-object> <name>identifier</name> <object>value1</object> <object>value2</object> <object>value3</object> </parent-object>
To
remove one or more values for such an object, a client application includes the
operation="delete"
attribute or the
operation="remove"
attribute in the opening tag for each
value. It does not include tag elements that represent values to be retained. In
the following example, the identifier tag element is called
<name>
:
<configuration> <!-- opening tags for each parent of the parent object --> <parent-object> <name>identifier</name> <object operation="(delete | remove)">value1</object> <object operation="(delete | remove)">value2</object> </parent-object> <!-- closing tags for each parent of the parent object --> </configuration>
We
recommend that the application set the default mode to no-change by including
the <default-operation>
tag element with the value
none
, as described in Set the Edit Configuration Mode in a NETCONF Session. For more information about leaf statements with multiple values, see Map Configuration Statements to Junos XML Tag Elements.
The
following example shows how to remove two of the permissions granted to the
user-accounts
login class:

Change History Table
Feature support is determined by the platform and release you are using. Use Feature Explorer to determine if a feature is supported on your platform.
<rpc-error>
response is
changed when <edit-config>
uses the
operation="delete"
operation to delete a configuration
element that is absent in the target configuration. The error severity is error
instead of warning, and the <rpc-error>
element includes
the <error-tag>data-missing</error-tag>
and
<error-type>application</error-type>
elements.