我的设备yang如下图——
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;
}
}
}
}
}
我正在使用SDNHub Netconf Client 来配置我的netconf 设备(我使用的是模拟器)。我可以添加配置,但无法修改设备上的配置。
我的设备上的初始配置如下所示
{
"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"
}
]
}
]
}
}
使用以下有效负载,
{
"ospf":
[
{
"process-id" : "21",
"networks": [
{
"subnet-ip": "12.12.12.12",
"area-id": 1212
}
]
}
]
}
根节点上的配置被覆盖,并在 GET 上为我提供以下数据
{
"router":
{
"ospf": [
{
"process-id": 21,
"networks": [
{
"subnet-ip": "12.12.12.12",
"area-id": 1212
}
]
}
]
}
}
如果我发送了错误的请求,或者是否有任何其他方式可以更新 Netconf 设备上的配置,请告诉我。