The delete command removes explicit configuration and returns the element configuration to the system default state or value. If there is no defined default for an element, the element returns to an unconfigured state.
The delete command can be used to delete any configuration element, such as:
leafs
containers
lists
leaf-lists
If an element has sub-elements (for example, a container with more containers and leafs), all of the sub-elements are also deleted as part of the parent deletion.
The following configuration example deletes three leafs; admin-state and connect-retry return to their default values, and description returns to an unconfigured state.
*[ex:/configure router "Base" bgp]
A:admin@node-2# info
admin-state disable
description "BGP description"
connect-retry 65535
*[ex:/configure router "Base" bgp]
A:admin@node-2# delete admin-state
*[ex:/configure router "Base" bgp]
A:admin@node-2# delete description
*[ex:/configure router "Base" bgp]
A:admin@node-2# delete connect-retry
*[ex:/configure router "Base" bgp]
A:admin@node-2# info detail
admin-state enable
## description
connect-retry 120
keepalive 30
damping false
local-preference 100
loop-detect ignore-loop
---snip---
To remove a container, the delete command is specified before the container name. The following examples show the deletion of a vprn instance from two different contexts.
*[ex:/configure service]
A:admin@node-2# info
vprn "vprn1" {
description "VPRN instance 01"
dns {
ipv6-source-address 2001:db8:aaa3::8a2e:3710:7335
}
bgp {
min-route-advertisement 50
}
interface "int1" {
ipv6 {
dhcp6 {
relay {
server ["2001:db8::" "2001:db9::" "2001:dba::" "2001:dc1::"]
}
}
}
}
}
*[ex:/configure service]
A:admin@node-2# delete vprn "vprn1"
[ex:/configure service]
A:admin@node-2# info detail | match vprn
## vprn
*[ex:/configure service]
A:admin@node-2# info
vprn "vprn1" {
description "VPRN instance 01"
dns {
ipv6-source-address 2001:db8:aaa3::8a2e:3710:7335
}
bgp {
min-route-advertisement 50
}
interface "int1" {
ipv6 {
dhcp6 {
relay {
server ["2001:db8::" "2001:db9::" "2001:dba::" "2001:dc1::"]
}
}
}
}
}
*[ex:/configure service]
A:admin@node-2# back
*[ex:/configure]
A:admin@node-2# delete service vprn "vprn1"
[ex:/configure]
A:admin@node-2# service
[ex:/configure service]
A:admin@node-2# info detail | match vprn
## vprn
In the preceding examples, the container is returned to an unconfigured state, as indicated by the ##.
In the following example, the timers element is a container, which contains sub-elements that are also containers; the lsa-generate and spf-wait elements. The placement of the delete command determines whether the timers element (and all of its sub-elements) are deleted, or one of the sub-elements.
*[ex:/configure router "Base" ospf 0]
A:admin@node-2# info
timers {
lsa-generate {
max-lsa-wait 8000
lsa-initial-wait 10
lsa-second-wait 1000
}
spf-wait {
spf-max-wait 2000
spf-initial-wait 50
spf-second-wait 100
}
}
area 0.0.0.0 {
}
To delete the lsa-generate element and its parameters, the delete command is specified before the lsa-generate element. The info command shows that the spf-wait parameters are still configured.
*[ex:/configure router "Base" ospf 0]
A:admin@node-2# timers delete lsa-generate
*[ex:/configure router "Base" ospf 0]
A:admin@node-2# info
timers {
spf-wait {
spf-max-wait 2000
spf-initial-wait 50
spf-second-wait 100
}
}
area 0.0.0.0 {
}
If the delete command is placed before the timers element, all elements within the timers element are also deleted.
*[ex:/configure router "Base" ospf 0]
A:admin@node-2# info
timers {
lsa-generate {
max-lsa-wait 8000
lsa-initial-wait 10
lsa-second-wait 1000
}
spf-wait {
spf-max-wait 2000
spf-initial-wait 50
spf-second-wait 100
}
}
area 0.0.0.0 {
}
*[ex:/configure router "Base" ospf 0]
A:admin@node-2# delete timers
[ex:/configure router "Base" ospf 0]
A:admin@node-2# info
area 0.0.0.0 {
}
To remove a list entry, the delete operation is specified before the list name and the entry to be removed.
*[ex:/configure service]
A:admin@node-2# info | match pw-template
pw-template "pw-1" {
pw-template "pw-3" {
pw-template "pw-5" {
pw-template "pw-8" {
*[ex:/configure service]
A:admin@node-2# delete pw-template ‟pw-3”
*[ex:/configure service]
A:admin@node-2# info | match pw-template
pw-template "pw-1" {
pw-template "pw-5" {
pw-template "pw-8" {
*[ex:/configure service]
A:admin@node-2#
*[ex:/configure service]
A:admin@node-2# info | match pw-template
pw-template "pw-1" {
pw-template "pw-5" {
pw-template "pw-8" {
*[ex:/configure service]
A:admin@node-2# delete pw-template *
*[ex:/configure service]
A:admin@node-2# info | match pw-template
*[ex:/configure service]
A:admin@node-2#
If the list is a multi-key list, a combination of specific members and wildcards (*) can be used.
In the following example, mep is a multikey list, where the keys are md-admin-name, ma-admin-name, and mep-id.
*[ex:/configure service epipe "svc-name" sap 1/1/4:1 eth-cfm]
A:admin@node-2# info
mep md-admin-name "ref1" ma-admin-name "ref2" mep-id 5 {
}
mep md-admin-name "ref1" ma-admin-name "ref3" mep-id 5 {
}
mep md-admin-name "ref6" ma-admin-name "ref3" mep-id 99 {
}
*[ex:/configure service epipe "svc-name" sap 1/1/4:1 eth-cfm]
A:admin@node-2#
The following delete operation deletes all lists with mep-id of 5, regardless of the md-admin-name or ma-admin-name.
*[ex:/configure service epipe "svc-name" sap 1/1/4:1 eth-cfm]
A:admin@node-2# delete mep md-admin-name * ma-admin-name * mep-id 5
*[ex:/configure service epipe "svc-name" sap 1/1/4:1 eth-cfm]
A:admin@node-2# info
mep md-admin-name "ref6" ma-admin-name "ref3" mep-id 99 {
}
*[ex:/configure service epipe "svc-name" sap 1/1/4:1 eth-cfm]
A:admin@node-2#
*[ex:/configure service epipe "svc-name" sap 1/1/4:1 eth-cfm]
A:admin@node-2# info
mep md-admin-name "ref1" ma-admin-name "ref2" mep-id 5 {
}
mep md-admin-name "ref1" ma-admin-name "ref3" mep-id 5 {
}
mep md-admin-name "ref6" ma-admin-name "ref3" mep-id 99 {
}
*[ex:/configure service epipe "svc-name" sap 1/1/4:1 eth-cfm]
A:admin@node-2# delete mep md-admin-name * ma-admin-name ‟ref3” mep-id 5
*[ex:/configure service epipe "svc-name" sap 1/1/4:1 eth-cfm]
A:admin@node-2# info
mep md-admin-name "ref1" ma-admin-name "ref2" mep-id 5 {
}
mep md-admin-name "ref6" ma-admin-name "ref3" mep-id 99 {
}
*[ex:/configure service epipe "svc-name" sap 1/1/4:1 eth-cfm]
A:admin@node-2#
*[ex:/configure service epipe "svc-name" sap 1/1/4:1 eth-cfm]
A:admin@node-2# info
mep md-admin-name "ref1" ma-admin-name "ref2" mep-id 5 {
}
mep md-admin-name "ref1" ma-admin-name "ref3" mep-id 5 {
}
mep md-admin-name "ref6" ma-admin-name "ref3" mep-id 99 {
}
*[ex:/configure service epipe "svc-name" sap 1/1/4:1 eth-cfm]
A:admin@node-2# delete mep md-admin-name ‟ref1” ma-admin-name * mep-id *
*[ex:/configure service epipe "svc-name" sap 1/1/4:1 eth-cfm]
A:admin@node-2# info
mep md-admin-name "ref6" ma-admin-name "ref3" mep-id 99 {
}
*[ex:/configure service epipe "svc-name" sap 1/1/4:1 eth-cfm]
A:admin@node-2#
To remove a leaf-list entry, the delete operation is specified before the leaf-list name and the entry to be removed.
*[ex:/configure system security user-params local-user user "test" console]
A:admin@node-2# info
member ["profile-a" "profile-b" "profile-x"]
*[ex:/configure system security user-params local-user user "test" console]
A:admin@node-2# delete member ‟profile-a”
*[ex:/configure system security user-params local-user user "test" console]
A:admin@node-2# info
member ["profile-b" "profile-x"]
*[ex:/configure system security user-params local-user user "test" console]
A:admin@node-2#
Multiple leaf-list entries can be deleted in a single command with the use of brackets. The entries do not need to be in any specific order.
*[ex:/configure system security user-params local-user user "test" console]
A:admin@node-2# info
member ["profile-a" "profile-b" "profile-f" "profile-x" "profile-c"]
*[ex:/configure system security user-params local-user user "test" console]
A:admin@node-2# delete member [‟profile-c” ‟profile-f”]
*[ex:/configure system security user-params local-user user "test" console]
A:admin@node-2# info
member ["profile-a" "profile-b" "profile-x"]
*[ex:/configure system security user-params local-user user "test" console]
A:admin@node-2#
*[ex:/configure system security user-params local-user user "test" console]
A:admin@node-2# info
member ["profile-b" "profile-x"]
*[ex:/configure system security user-params local-user user "test" console]
A:admin@node-2# delete member *
*[ex:/configure system security user-params local-user user "test" console]
A:admin@node-2# info
*[ex:/configure system security user-params local-user user "test" console]
A:admin@node-2#
*[ex:/configure system security user-params local-user user "test" console]
A:admin@node-2# delete member [*]
Deleting all members of a leaf-list sets the list to the unconfigured state (as indicated in the info detail display by the ‟##”).
*[ex:/configure system security user-params local-user user "test" console]
A:admin@node-2# delete member *
*[ex:/configure system security user-params local-user user "test" console]
A:admin@node-2# info detail | match member
## member
*[ex:/onfigure system security user-params local-user user "test" console]
A:admin@node-2#