[NETCONF-301] create-data-change-event-subscription response is not in XML format despite request was "application/xml" Created: 20/Oct/16  Updated: 06/Dec/22  Resolved: 06/Dec/22

Status: Resolved
Project: netconf
Component/s: restconf-nb
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Juraj Veverka Assignee: Ivan Hrasko
Resolution: Won't Do Votes: 0
Labels: pt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Attachments: File openstack.postman_collection.json    
External issue ID: 6994

 Description   

following "Change event notification subscription" procedure on odl wiki https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL:Restconf:Change_event_notification_subscription

setup environment:
------------------
1. start odl distribution-karaf-0.5.0-Boron
2. install features:
feature:install odl-restconf
feature:install odl-dlux-all
feature:install odl-ovsdb-southbound-impl
log:set DEBUG org.opendaylight.netconf.sal

when I send create-data-change-event-subscription request (see postman collection) with Content-Type "application/xml" response is in JSON format

request:
<input xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:remote">
<path xmlns:a="urn:TBD:params:xml:ns:yang:network-topology">/a:network-topology</path>
<datastore xmlns="urn:sal:restconf:event:subscription">CONFIGURATION</datastore>
<scope xmlns="urn:sal:restconf:event:subscription">BASE</scope>
</input>

response:
{
"output":

{ "stream-name": "data-change-event-subscription/network-topology:network-topology/datastore=CONFIGURATION/scope=BASE" }

}



 Comments   
Comment by Juraj Veverka [ 20/Oct/16 ]

Attachment openstack.postman_collection.json has been added with description: postman collection

Comment by Ivan Hrasko [ 06/Dec/22 ]

In the Netconf version 5 the request looks like:

POST http://localhost:8181/rests/operations/sal-remote:create-data-change-event-subscription

with the payload:

<input xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:remote">
  <path xmlns:a="urn:TBD:params:xml:ns:yang:network-topology">/a:network-topology</path>
  <datastore xmlns="urn:sal:restconf:event:subscription">CONFIGURATION</datastore>
  <scope xmlns="urn:sal:restconf:event:subscription">BASE</scope>
</input>

and the result depends on the Accept header not Content-Type!

With Accept set to application/xml we successfully get:

<output xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:remote">
  <stream-name>data-change-event-subscription/network-topology:network-topology/datastore=CONFIGURATION/scope=BASE</stream-name>
</output>
Comment by Ivan Hrasko [ 06/Dec/22 ]

The issue in not present. User has misconfigured his request (used wrong header parameter).

Generated at Wed Feb 07 20:14:40 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.