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

RESTCONF missing module name for 'devices'

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?

Everyone's tags (3)
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Cisco Employee

Re: RESTCONF missing module name for 'devices'

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
Highlighted
Cisco Employee

Re: RESTCONF missing module name for 'devices'

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

Highlighted
Cisco Employee

Re: RESTCONF missing module name for 'devices'

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.

Highlighted
Beginner

Re: RESTCONF missing module name for 'devices'

ahhh that was it.  Thank you!!