cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
715
Views
0
Helpful
2
Replies

RESTCONF call

suvdeshm
Cisco Employee
Cisco Employee

We have few service packages installed on a RFS node and I am able to get the results for the restconf url

 

By making a curl call :

curl  -k -u 'xx:xxx' /restconf/data/casb:casb/rfs

The entire rfs tag is returned shown below. 

<rfs xmlns="http://com/cisco/casb" xmlns:casb="http://com/cisco/casb">
    <platform xmlns="http://com/cisco/casb/rfs/bplatform">
      <device-list>DC-N5548</device-list>

</platform>

<interface xmlns="http://com/cisco/casb/rfs/interface">
<device>DC-N5548</device>
<device-list>DC-N5548</device-list>

</interface>

 

But the customer wants to display the tag <device-list>. But I am unable to get the right uri  for the <devices> and <device-list> nodes  http://serveripaddress:port/restconf/data/casb:casb/rfs/platform/device-list

 

Any way I change the uri I am unable to get that output. It gives error for any url. For example:

curl  -k -u 'xx:xxx' https://10.81.59.53:4000/restconf/data/casb:casb/rfs/platform

<errors xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf">

  <error>

    <error-message>uri keypath not found</error-message>

    <error-tag>invalid-value</error-tag>

    <error-type>application</error-type>

  </error>

</errors>

2 Replies 2

yfherzog
Cisco Employee
Cisco Employee

Have a look here:https://tools.ietf.org/html/rfc8040#appendix-B.3.3

 

You'd need to provide in the URI the path to the list, and then add "?fields=..."

Your accept header would need to be something like: -H "Accept: application/vnd.yang.collection+json"

gmuloche
Cisco Employee
Cisco Employee

Based on this output snippet it seems that you have a different namespace/module-name for rfs and for platform. 

 

<rfs xmlns="http://com/cisco/casb" xmlns:casb="http://com/cisco/casb">
    <platform xmlns="http://com/cisco/casb/rfs/bplatform">
      <device-list>DC-N5548</device-list>
    </platform>

I am not sure what the module-name is for platform though, but for example if I assume the module name is bplatform then your URL should look like:

http://serveripaddress:port/restconf/data/casb:casb/rfs/bplatform:platform/device-list

 

from RFC 8040 -https://tools.ietf.org/html/rfc8040#section-3.5.3:

 If a node in the path is defined in a module other than its parent node
or its parent is the datastore, then the module name followed by a colon
character (":") MUST be prepended to the node name in the resource identifier.