10-08-2020 08:57 AM
Having trouble trying to translate this old rest API uri to use restconf now.
http://nsolab.com:8080/api/operational/engdb/aggSystems/3933/systemsAndRoutes/OMS?deep
CLI Command:
show engdb circuit 108243 mocn false sites 1709
Yang Snippet:
module engdb {
namespace "http://nsolab.com/nso/engdb";
prefix engdb;
import ietf-inet-types { prefix inet; }
import ietf-yang-types { prefix yang; }
import tailf-common { prefix tailf; }
container engdb {
tailf:info "EngDB Data Provider displaying router details";
config false;
list aggSystems {
tailf:callpoint "agg-dp";
key queryDeviceID;
leaf queryDeviceID {
type uint32;
}
list systemsAndRoutes {
key serviceType;
leaf serviceType {
type enumeration {
enum OMS;
enum CLTE;
}
}
must serviceType = 'OMS' or serviceType = 'CLTE'" {
error-message "The service type must be set to OMS, or CLTE";
}
}
}
}I have tried the following and multiple variations with no success. I have changed the method to POST from GET
http://nsolab.com:8080/restconf/operations/engdb/aggSystems/3933/systemsAndRoutes/OMS
Solved! Go to Solution.
10-08-2020 10:51 AM
Hello
in theory you should be able to do (caveat if you are using NSO 5 you will need to add the module names which I have added here):
http://nsolab.com:8080/restconf/data/engdb:engdb/aggSystems=3933/systemsAndRoutes=OMS
(note using GET operation)
example (I have hardcoded the answer and added some test leaf here):
CLI
admin@scratch# show engdb aggSystems 45
QUERY
DEVICE SERVICE
ID TYPE
-----------------
45 OMS
CLTE
admin@scratch# show engdb aggSystems 45 systemsAndRoutes OMS
SERVICE
TYPE
---------
OMS
Curl
curl --location --request GET 'http://127.0.0.1:8080/restconf/data/engdb:engdb/aggSystems=3393' --header 'Authorization: Basic YWRtaW46YWRtaW4='
<aggSystems xmlns="http://nsolab.com/nso/engdb" xmlns:engdb="http://nsolab.com/nso/engdb">
<queryDeviceID>3393</queryDeviceID>
<systemsAndRoutes>
<serviceType>OMS</serviceType>
</systemsAndRoutes>
<systemsAndRoutes>
<serviceType>CLTE</serviceType>
</systemsAndRoutes>
</aggSystems>
curl --location --request GET 'http://127.0.0.1:8080/restconf/data/engdb:engdb/aggSystems=3393/systemsAndRoutes=OMS' --header 'Authorization: Basic YWRtaW46YWRtaW4='
<systemsAndRoutes xmlns="http://nsolab.com/nso/engdb" xmlns:engdb="http://nsolab.com/nso/engdb">
<serviceType>OMS</serviceType>
</systemsAndRoutes>
10-08-2020 10:51 AM
Hello
in theory you should be able to do (caveat if you are using NSO 5 you will need to add the module names which I have added here):
http://nsolab.com:8080/restconf/data/engdb:engdb/aggSystems=3933/systemsAndRoutes=OMS
(note using GET operation)
example (I have hardcoded the answer and added some test leaf here):
CLI
admin@scratch# show engdb aggSystems 45
QUERY
DEVICE SERVICE
ID TYPE
-----------------
45 OMS
CLTE
admin@scratch# show engdb aggSystems 45 systemsAndRoutes OMS
SERVICE
TYPE
---------
OMS
Curl
curl --location --request GET 'http://127.0.0.1:8080/restconf/data/engdb:engdb/aggSystems=3393' --header 'Authorization: Basic YWRtaW46YWRtaW4='
<aggSystems xmlns="http://nsolab.com/nso/engdb" xmlns:engdb="http://nsolab.com/nso/engdb">
<queryDeviceID>3393</queryDeviceID>
<systemsAndRoutes>
<serviceType>OMS</serviceType>
</systemsAndRoutes>
<systemsAndRoutes>
<serviceType>CLTE</serviceType>
</systemsAndRoutes>
</aggSystems>
curl --location --request GET 'http://127.0.0.1:8080/restconf/data/engdb:engdb/aggSystems=3393/systemsAndRoutes=OMS' --header 'Authorization: Basic YWRtaW46YWRtaW4='
<systemsAndRoutes xmlns="http://nsolab.com/nso/engdb" xmlns:engdb="http://nsolab.com/nso/engdb">
<serviceType>OMS</serviceType>
</systemsAndRoutes>
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