How to use NB RESTCONF to get the information of Netconf devices?

55 views
Skip to first unread message

liverpo...@gmail.com

unread,
Aug 8, 2018, 5:26:15 AM8/8/18
to Dynamic configuration
Dear all,

I have some questions about RESTCONF and Netconf device. It will be really appreciate if you can give me some hints. 
I followed https://wiki.onosproject.org/display/ONOS/NETCONF this website and installed the Mininet machine with of-config installed.
The Netconf device is connected with my ONOS (1.14)successfully, and i can also see it from the ONOS GUI. 

onos> devices
id=netconf:192.168.1.101:830, available=true, local-status=connected 8s ago, role=MASTER, type=VIRTUAL, mfr=Of-Config, hw=VirtualBox, sw=1.0, serial=1, chassis=0, driver=ovs-netconf, ipaddress=192.168.1.101, locType=none, name=netconf:192.168.1.101:830, port=830, protocol=NETCONF

As you can see, the device's name is netconf:192.168.1.101:830
Unfortunately i got the resource not found error ... 

error   
error-type   "protocol"
error-tag   "invalid-value"
error-app-tag   "handleGetRequest"
error-path   "devices/device=netconf:192.168.1.101:830"
error-message   "Resource not found"

I already  activated  all the related modules by  org.onosproject.openroadm. 
What I want to do is just getting the basic information from  the netconf device, but always resource not found .
I do not know why this happened ...Did I miss some steps before I used the GET?

One more questions is that , this URL  http://127.0.0.1:8181/onos/restconf/data/devices/device= netconf:192.168.1.101:830 
can help me get the information of the netconf device whose name is  netconf:192.168.1.101:830.  If i want to get the information of all the connected netconf devices, what URL  should I use? I tried http://127.0.0.1:8181/onos/restconf/data/devices but failed...

Thanks
Best wishes

Henry Yu

unread,
Aug 8, 2018, 9:53:08 AM8/8/18
to liverpo...@gmail.com, Dynamic configuration

Hi,

 

Could you please set the log level to DEBUG, and then try again RESTCONF GET device?  This way, RESTCONF will print full exception trace (if there are any) to karaf.log.   Please send us the karaf.log.

 

log:set DEBUG org.onosproject.protocol.restconf.server.rpp.RestconfWebResource

log:set DEBUG org.onosproject.restconf.utils.RestconfUtils

 

 

Thanks,

Henry

--
You received this message because you are subscribed to the Google Groups "Dynamic configuration" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brigade-dyncon...@onosproject.org.
To post to this group, send email to brigade-...@onosproject.org.
Visit this group at https://groups.google.com/a/onosproject.org/group/brigade-dynconfig/.
To view this discussion on the web visit https://groups.google.com/a/onosproject.org/d/msgid/brigade-dynconfig/a23257c8-85ee-4185-97b4-251762de6fef%40onosproject.org.
For more options, visit https://groups.google.com/a/onosproject.org/d/optout.

liverpo...@gmail.com

unread,
Aug 9, 2018, 3:45:25 AM8/9/18
to Dynamic configuration, liverpo...@gmail.com, henr...@huawei.com
Dear Henry Yu
This is the log when the netconf device is connected and after I sent the RESTCONF GET
 
2018-08-08 23:24:39,804 | INFO  | vice-installer-1 | DeviceManager                    | 134 - org.onosproject.onos-core-net - 1.14.0.SNAPSHOT | Device netconf:192.168.10.111:830 registered
2018-08-08 23:24:39,810 | INFO  | vice-installer-1 | DeviceManager                    | 134 - org.onosproject.onos-core-net - 1.14.0.SNAPSHOT | Local role is MASTER for netconf:192.168.10.111:830
2018-08-08 23:24:39,810 | INFO  | vice-installer-1 | DeviceManager                    | 134 - org.onosproject.onos-core-net - 1.14.0.SNAPSHOT | Device netconf:192.168.10.111:830 connected
2018-08-08 23:24:39,818 | INFO  | nos-topo-build-3 | TopologyManager                  | 134 - org.onosproject.onos-core-net - 1.14.0.SNAPSHOT | Topology DefaultTopology{time=4390778102921, creationTime=1533795879817, computeCost=116935, clusters=1, devices=1, links=0} changed

2018-08-08 23:26:30,564 | DEBUG | qtp1483133165-37 | RestconfWebResource              | 195 - org.onosproject.onos-protocols-restconf-server-rpp - 1.14.0.SNAPSHOT | handleGetRequest: devices/device=netconf:192.168.10.111:830
2018-08-08 23:27:03,667 | DEBUG | qtp1483133165-37 | RestconfWebResource              | 195 - org.onosproject.onos-protocols-restconf-server-rpp - 1.14.0.SNAPSHOT | handleGetRequest: devices/device=netconf:192.168.10.111:830

Anything wrong with this log??I still got 404 error after RESTCOF GET 
I download the Mininet machine with of-config installed from https://wiki.onosproject.org/display/ONOS/NETCONF 

Thanks 
     
在 2018年8月8日星期三 UTC+9下午10:53:08,Henry Yu写道:

Henry Yu

unread,
Aug 9, 2018, 7:06:41 PM8/9/18
to liverpo...@gmail.com, Dynamic configuration

Hi,  This log does not show any errors.  Did you see any logs after the following line, or was this the last line in the log ?

 

2018-08-08 23:27:03,667 | DEBUG | qtp1483133165-37 | RestconfWebResource              | 195 - org.onosproject.onos-protocols-restconf-server-rpp - 1.14.0.SNAPSHOT | handleGetRequest: devices/device=netconf:192.168.10.111:830

 

Thanks,

liverpo...@gmail.com

unread,
Aug 9, 2018, 7:42:32 PM8/9/18
to Dynamic configuration, liverpo...@gmail.com, henr...@huawei.com
Hi,Henry

2018-08-09 16:18:42,555 | INFO  | vice-installer-1 | DeviceManager                    | 134 - org.onosproject.onos-core-net - 1.14.0.SNAPSHOT | Device netconf:192.168.10.111:830 connected
2018-08-09 16:18:42,564 | INFO  | nos-topo-build-6 | TopologyManager                  | 134 - org.onosproject.onos-core-net - 1.14.0.SNAPSHOT | Topology DefaultTopology{time=19128393345137, creationTime=1533856722562, computeCost=243851, clusters=1, devices=1, links=0} changed

2018-08-09 16:19:49,285 | DEBUG | qtp436862865-43  | RestconfWebResource              | 195 - org.onosproject.onos-protocols-restconf-server-rpp - 1.14.0.SNAPSHOT | handleGetRequest: devices/device=netconf:192.168.10.111:830

I tried again, and the same log was shown.
It is the last line of the log after I used RESTCONF GET. So i am confused about that.

Actually before I try to get information from Netconf devices:
When I use this RESTCONF URL http://127.0.0.1:8181/onos/restconf/data/org-openroadm-network:network I got a 404 resource not found error.
 {
  "org-openroadm-network:network": {}
}
   

So, maybe this time, although I already have a netconf device connected, I still need to post something at first(Write a top level device object first?).But I dont know how to do that.
we need to Put /onos/restconf/data/devices/device=xyz 

{

   “device-id” : “xyz”      < - - I don’t know the device yang model. I am just making an example.  
    "device" : "netconf:127.0.0.1:8301"
}

to create a datanode.

The device I used is  Mininet machine with of-config installed which is download from onos netconf tutorial.

My netconf device's name is netconf:192.168.10.111:830, but what is the "device-id " i shoud fill in?

Thank you so much for help

best wishes 


在 2018年8月10日星期五 UTC+9上午8:06:41,Henry Yu写道:

Ahmed Khalil

unread,
Dec 7, 2022, 6:53:01 AM12/7/22
to Dynamic configuration, liverpo...@gmail.com, henr...@huawei.com
hi, 
I'm trying to do the same "use NB RESTCONF to get the information of Netconf devices" ,however I'm getting the same error ""Resource not found", how you resolved the problem.

thanks,
Ahmed 
Reply all
Reply to author
Forward
0 new messages