My device yang is as shown below -
module router {
yang-version 1;
namespace "urn:sdnhub:odl:tutorial:router";
prefix router;
description "Router configuration";
revision "2015-07-28" {
description "Initial version.";
}
list interfaces {
key id;
leaf id {
type string;
}
leaf ip-address {
type string;
}
}
container router {
list ospf {
key process-id;
leaf process-id {
type uint32;
}
list networks {
key subnet-ip;
leaf subnet-ip {
type string;
}
leaf area-id {
type uint32;
}
}
}
list bgp {
key as-number;
leaf as-number {
type uint32;
}
leaf router-id {
type string;
}
list neighbors {
key as-number;
leaf as-number {
type uint32;
}
leaf peer-ip {
type string;
}
}
}
}
}
I am using the SDNHub Netconf Client to configure my netconf device(I'm using a simulator). I'm able to add configurations, but I'm not able to modify configurations on the device.
The initial configurations on my device is shown below
{
"router": {
"ospf": [
{
"process-id": 21,
"networks": [
{
"subnet-ip": "12.1.1.1",
"area-id": 12
}
]
}
],"bgp": [
{
"as-number": "31",
"router-id": "123",
"neighbors": [
{
"as-number": "31",
"peer-ip": "1.1.1.1"
}
]
},
{
"as-number": "32",
"router-id": "1234",
"neighbors": [
{
"as-number": "32",
"peer-ip": "2.2.2.2"
}
]
}
]
}
}
I'm trying to modify the ospf list with PUT http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/testtool/yang-ext:mount/router:router/ospf/21
with the following payload,
{
"ospf":
[
{
"process-id" : "21",
"networks": [
{
"subnet-ip": "12.12.12.12",
"area-id": 1212
}
]
}
]
}
The configurations on the root node gets over-written and gives me the following data on GET
{
"router":
{
"ospf": [
{
"process-id": 21,
"networks": [
{
"subnet-ip": "12.12.12.12",
"area-id": 1212
}
]
}
]
}
}
Please let me know if I'm sending a wrong request or if there is any other way to update configurations on a Netconf device.