03-20-2020 01:59 AM
I am converting to RESTCONF, and I have success with RESTCONF calls to device setup, check-sync, etc., but not services.
I have NSO services, which I call over the REST API, e.g. like this:
http://{{host}}:8080/api/running/open-net-access/inventory?deep
using Content-Type and Accept application/vnd.yang.data+json
In this specific case the inventory is container in the open-net-access service, and the data structure looks like this:
Solved! Go to Solution.
03-20-2020 06:56 AM
Usually the first thing to check is that the 'namespace identifier' e.g. the 'open-net' in your example:
open-net:open-net-access
Changes when converting from REST -> RESTCONF
In RESTCONF this needs to be the name of the module, not the prefix defined in the module as would be the case for REST.
Is your service, open-net-access a container, i.e. not a list?
If it is a list, you'll need to specify the key, here's and example (this service is augmented under the services tree):
http://127.0.0.1:8080/restconf/data/tailf-ncs:services/l2vpnpy:l2vpn=BD-109/customer_id
l2vpn is the service in module l2vpnpy.
03-20-2020 06:56 AM
Usually the first thing to check is that the 'namespace identifier' e.g. the 'open-net' in your example:
open-net:open-net-access
Changes when converting from REST -> RESTCONF
In RESTCONF this needs to be the name of the module, not the prefix defined in the module as would be the case for REST.
Is your service, open-net-access a container, i.e. not a list?
If it is a list, you'll need to specify the key, here's and example (this service is augmented under the services tree):
http://127.0.0.1:8080/restconf/data/tailf-ncs:services/l2vpnpy:l2vpn=BD-109/customer_id
l2vpn is the service in module l2vpnpy.
03-20-2020 08:29 AM
Thank you very much for the response. It made me understand what was wrong and how to do it.
open-net-access is a container, not a list. And the module is also called open-net-access.
This a GET of the inventory that works: http://{{host}}:8080/restconf/data/open-net-access:open-net-access/inventory
And this is used for POST and PATCH as well of new items in the inventory with details in the body of course.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide