cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
365
Views
0
Helpful
1
Replies

API call referencing a key containing two leaf items.

hwatson
Cisco Employee
Cisco Employee

Hello,

I'm having a problem trying to work out how to navigate the API when a key item in a list contains two leaf entries. 

Here's the YANG part of interest:

list ISP_Gateway {

  key "ISPGateway Exchange";

leaf ISPGateway {

   type leafref {

     path "/ncs:devices/ncs:device/ncs:name";            

     }

  } 

  leaf Exchange {

     type string;

  }

<SNIP>

Here's an example of referencing the service from the cli:

services IXP-Peering Perth ISP_Gateway test-isp-gw1 Equinix Peer Harry

Does anyone know the syntax when trying to do this via API GET?  I've tried the following which didn't work in POSTMAN:

http://127.0.0.1:8080/api/running/services/IXP-Peering/Perth/ISP_Gateway/test-isp-gw1 Equinix/

http://127.0.0.1:8080/api/running/services/IXP-Peering/Perth/ISP_Gateway/test-isp-gw1%20Equinix/

http://127.0.0.1:8080/api/running/services/IXP-Peering/Perth/ISP_Gateway/test-isp-gw1+Equinix/

http://127.0.0.1:8080/api/running/services/IXP-Peering/Perth/ISP_Gateway/test-isp-gw1/Equinix/

If I set the key to be a single leaf item e.g. 'ISPGateway' then all works fine, i.e.

http://127.0.0.1:8080/api/running/services/IXP-Peering/Perth/ISP_Gateway/test-isp-gw1/Peer/Harry

Any suggestions appreciated.

Many Thanks,

Harry

1 Accepted Solution

Accepted Solutions

hwatson
Cisco Employee
Cisco Employee
1 Reply 1

hwatson
Cisco Employee
Cisco Employee

Hi,

Found the syntax, and its basically a comma between the leaf items.

e.g.

http://127.0.0.1:8080/api/running/services/IXP-Peering/Perth/ISP_Gateway/test-isp-gw1,Equinix/Peer/Harry

Thanks!

Harry