我正在尝试以 JSON 格式发送具有属性“inactive”:“inactive”的正文,但 opendaylight 控制器不接受以下格式。
curl --location --request POST 'http://10.13.82.108:8181/restconf/operations/network-topology:network-topology/topology/topology-netconf/node/denali-vpn-jess1/yang-ext:mount /ietf-netconf:edit-config'
--header '授权:基本 YWRtaW46YWRtaW4='
--header '内容类型:application/json'
--header '接受:application/xml' \
--data '{
"input": {
"target": {
"candidate": ""
},
"config": {
"configuration": {
"interfaces": {
"interface": {
"@" : {
"inactive" : "inactive"
},
"name": "ps1"
}
}
}
}
}
}'
--data '{
"input": {
"target": {
"candidate": ""
},
"config": {
"configuration": {
"interfaces": {
"interface": {
"-active": "active",
"name": "ps1"
}
}
}
}
}
}'
--data '{
"input": {
"target": {
"candidate": ""
},
"config": {
"configuration": {
"interfaces": {
"interface": {
"@inactive": "inactive",
"name": "ps1"
}
}
}
}
}
}'
控制器接受 XML 中的等效属性。