08-26-2019 08:44 AM - edited 08-26-2019 09:19 AM
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>
08-26-2019 11:07 PM
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"
08-27-2019 01:22 AM
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.
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