cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3719
Views
20
Helpful
3
Replies

RESTCONF missing module name for 'devices'

Denis Pointer
Level 1
Level 1

Hello, I've been doing some labbing using NSO 5.1.0.1.  Currently I am working on understanding the API's and REST vs RESTONF

 

When GET against this REST API URL I get the output I expect.

 

 curl -u admin:admin 'http://127.0.0.1:8080/api/running/devices/device/ios0'

<device xmlns="http://tail-f.com/ns/ncs" xmlns:y="http://tail-f.com/ns/rest"  xmlns:ncs="http://tail-f.com/ns/ncs">
  <name>ios0</name>
!!! output omitted for brevity

 

However, when I try against what I understand should be equivalent RESTCONF API I get an error...

curl -u admin:admin 'http://127.0.0.1:8080/restconf/data/devices/device=ios0'
<errors xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf">
  <error>
    <error-message>missing module name for 'devices'</error-message>
    <error-tag>missing-attribute</error-tag>
    <error-type>application</error-type>
  </error>
</errors>

what am I missing?

1 Accepted Solution

Accepted Solutions

vleijon
Cisco Employee
Cisco Employee
It seems like you have to use the explicit namespace prefix: curl -u admin:admin http://localhost:8080/restconf/data/tailf-ncs:devices/device=ios0 works for me.

View solution in original post

3 Replies 3

vleijon
Cisco Employee
Cisco Employee
It seems like you have to use the explicit namespace prefix: curl -u admin:admin http://localhost:8080/restconf/data/tailf-ncs:devices/device=ios0 works for me.

To clarify, it is the YANG module name that is used.

It is also possible to configure this required module-name for api-identifiers with /ncs-config/restconf/require-module-name, which is default true.

For more details see ncs.conf(5) man page and RFC 8040 RESTCONF Protocol, Section 3.5.3. Encoding Data Resource Identifiers in the Request URI.

Denis Pointer
Level 1
Level 1

ahhh that was it.  Thank you!!

Polls
AI-powered tools for network troubleshooting are likely to be part of everyone’s workflow sooner or later. What is the single biggest challenge or concern you see with adopting these tools in your organization?