I am needing to modify my Openflow configurations in my Opendaylight (0.11.x sodium) system. I follow the documentation which has helped guide is in
- creating new configs
- deleting configs
- replacing configs
- but I am not seeing an example or explanation on how to modify (or merge) a configuration.
The top paragraph references modifying a config but doesn't actually show an example. And just to be clear, by modification I mean a merge operation. I.e., in terms of the netconf edit-config RFC-6241, I am wanting to modify only some of the leafs of a config, but keep older leafs.
Unfortunately, the options I see given in the openflow documentation is only creating, deleting, and replacing. We need to figure out how to do a merge.
In doing some research, it appears there is functionality with REST PATCH
commands, however I am unable to get Opendaylight to work with it. Here is what I am trying:
PATCH //127.0.0.1:8181/restconf/config/opendaylight-inventory:nodes/node/openflow:244354675513412/table/0/flow/105 HTTP/1.1
Content-Type: application/yang.patch+xml
Accept: application/yang.patch+json
Authorization: Basic YWRtaW46YWRtaW4=
User-Agent: PostmanRuntime/7.26.8
Postman-Token: 875a3c91-f6b1-4d21-8f2d-615b3c4b5cdd
Host: 127.0.0.1:8181
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Content-Length: 1233
Cookie: JSESSIONID=node0dqx2exo4lrydz1adjhvc9lum374.node0
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<flow xmlns='urn:opendaylight:flow:inventory' xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
<strict>false</strict>
<id>105</id>
<priority>9</priority>
<table_id>0</table_id>
<hard-timeout>0</hard-timeout>
<idle-timeout>0</idle-timeout>
<flow-name>10dot0SubnetToPort1_from_4</flow-name>
<match>
<ethernet-match>
<ethernet-type>
<type>2048</type>
</ethernet-type>
<ethernet-destination>
<address>FF:FF:29:01:19:61</address>
</ethernet-destination>
<ethernet-source>
<address>00:00:00:11:23:AE</address>
</ethernet-source>
</ethernet-match>
</match>
<instructions>
<instruction>
<order>1</order>
<apply-actions>
<action>
<order>0</order>
<output-action>
<output-node-connector>6</output-node-connector>
<max-length>66</max-length>
</output-action>
</action>
</apply-actions>
</instruction>
</instructions>
</flow>
But the response I get back is: 406 Not Acceptable
and nothing else... No <error...
rpc-response or anything. I also am studying the log files in DEBUG and TRACE mode and can't pick up any hint as to what is going wrong.
I also tried pasting in nc:operation='merge'
to each element like this...
...
<output-action nc:operation='merge'>
<output-node-connector nc:operation='merge'>6</output-node-connector>
<max-length nc:operation='merge'>66</max-length>
</output-action>
...
But this also results in the same 406 Not Acceptable
response.
Goal: how does one properly merge/modify a config in OpenDaylight/Openflow
Try to install 'odl-restconf-nb-RFC8040' endpoint on your karaf shell. ODL provides two end-point for restconf communication. Although less documents on RFC-8040, yang-patch gives no error through that. (YANG-PATCH allows "create, delete, insert, merge, move, replace, remove" operations. Creating, modifying and deleting configs can be done by changing operation in this payload. https://docs.opendaylight.org/projects/netconf/en/latest/user-guide.html#reconfiguring-an-existing-connector )
RFC-8040 defines YANG-PATCH according to this RFC : https://datatracker.ietf.org/doc/html/draft-ietf-netconf-yang-patch-14#section-2
Your header looks good.
Your API will begin like : PATCH //127.0.0.1:8181/rests/data/.../...