in the below yang model , have a list entry with a integer key named sequence.
when i add a entry with key as 155 ,it adds.
when i add a entry wit key as 15 ,it updates the 155 key record.
similarly when i add a entry wiht key as 1, it again updates the 155 key record.
what could be the issue. the list key is highlighted in bold.
YANG model
grouping router-prefix-list-config {
list prefix-list {
description "Prefix list instance";
key "type name";
leaf type {
description "Prefix list type";
type prefix-list-type;
}
leaf name {
description "Prefix list name";
type string {
length 1..64;
}
}
list entry {
description "Prefix list entry";
key "sequence";
leaf sequence {
description "Prefix list sequence value";
type uint32 {
range "1..4294967295";
}
}
leaf action {
...........................
CLI Queries
admin@config-service-0 06:08:45> show table MEDFunction router-cfg
prefix-list ipv4 Test-v4 {
entry 155 {
action deny;
ipv4-prefix 10.10.10.0/25;
ipv4-prefix-length-lesser-or-equal 30;
}
}
[ok][2022-12-05 06:08:47]
admin@config-service-0 06:08:47> configure
Entering configuration mode private
[ok][2022-12-05 06:08:51]
[edit]
admin@config-service-0 06:08:51% set MEDFunction router-cfg prefix-list ipv4 Test-v4 entry **15** ipv4-prefix 10.10.10.0/23 ipv4-prefix-length-lesser-or-equal 30 action deny
[ok][2022-12-05 06:09:21]
[edit]
admin@config-service-0 06:09:21% commit
Commit complete.
[ok][2022-12-05 06:09:26]
[edit]
admin@config-service-0 06:09:26% set MEDFunction router-cfg prefix-list ipv4 Test-v4 entry **1** ipv4-prefix 10.10.10.0/25 ipv4-prefix-length-lesser-or-equal 30 action den
[edit]
admin@config-service-0 06:09:34% exit
[ok][2022-12-05 06:09:38]
admin@config-service-0 06:09:38> show table MEDFunction router-cfg
prefix-list ipv4 Test-v4 {
entry 155 {
action deny;
ipv4-prefix 10.10.10.0/23;
ipv4-prefix-length-lesser-or-equal 30;
}
}
[ok][2022-12-05 06:09:42]
admin@config-service-0 06:09:42> configure
Entering configuration mode private
[ok][2022-12-05 06:09:48]
[edit]
admin@config-service-0 06:09:48% set MEDFunction router-cfg prefix-list ipv4 Test-v4 entry 1 ipv4-prefix 10.10.10.0/24 ipv4-prefix-length-lesser-or-equal 30 action deny
[ok][2022-12-05 06:10:13]
[edit]
admin@config-service-0 06:10:13% commit
Commit complete.
[ok][2022-12-05 06:10:17]
[edit]
admin@config-service-0 06:10:17% exit [ok][2022-12-05 06:10:30]
admin@config-service-0 06:10:30> show table MEDFunction router-cfg
prefix-list ipv4 Test-v4 {
entry 155 {
action deny;
ipv4-prefix 10.10.10.0/24;
ipv4-prefix-length-lesser-or-equal 30;
}
}
[ok][2022-12-05 06:10:33]
admin@config-service-0 06:10:33>