03-06-2024 01:07 PM
Hi
I am working with NSO automation team and I am new
If I run generic query for config i get all the data I need to pull specific data using curl
My query using curl is success full and it returns tons of data
curl --location 'http://localhost:8080/restconf/data/tailf-ncs:devices/device=ORUD0407/config/tailf-ned-cisco-staros:context/' \
--header 'Accept: application/yang-data+json' \
--header 'Authorization: Basic ###############################'
{
"name": "up",
"bgp": "extended-asn-cap",
"bfd-protocol": {
"slow-timers": 1000
},
"ip": {
"igmp": [ { "profile": "default" } ],
"prefix-list": [ {"name": "up", "seq": "10", "action": "permit", "addresses": "10.193.124.144/28", "le": 32},
{"name": "up", "seq": "15", "action": "permit", "addresses": "10.193.126.0/28", "le": 32 },
{"name": "up","seq": "20","action": "permit", "addresses": "10.193.126.16/28","le": 32 },
{"name": "up", "seq": "25", "action": "permit", "addresses": "10.193.124.128/28", "le": 32 },
{"name": "up", "seq": "30", "action": "permit", "addresses": "172.30.137.80/28", "le": 32} ]
},
"interface": [],
"gtpp": { "group": [ { "name": "default", "gtpp": { "limit-secondary-rat-usage-conf": { "limit-secondary-rat-usage": 32 } } } ]
},
"gtpu-service": [],
"sx-service": [],
"user-plane-service": [ { "name": "upf_up3", "associate": {
"gtpu-service": [],
"sx-service": "sxc_up3",
"fast-path": {"service": [null]},
"control-plane-group": "cp-group-1"
}
}
],
"aaa": {},
"router": {},
"subscriber": {},
"route-map": [{ }]
},
I more interested in getting control plane group using curl and my this query fails
curl --location 'http://localhost:8080/restconf/data/tailf-ncs:devices/device=ORUD0407/config/tailf-ned-cisco-staros:context/user-service-plane' \
--header 'Accept: application/yang-data+json' \
--header 'Authorization: Basic ###############################'
{ "ietf-restconf:errors": { "error": [ {
"error-type": "application",
"error-tag": "invalid-value",
"error-message": "uri keypath not found" }]
}}
I can get same information from CLI
show running-config devices device ORUD0407 config control-plane-group
devices device ORUD0407
config
control-plane-group cp-group-1
peer-node-id ipv4-address 1.3.1.6
peer-node-id ipv4-address 1.3.1.7
peer-node-id ipv4-address 1.3.1.3 interface n4
peer-node-id ipv4-address 1.3.1.9 interface n4
exit
!
!
Thanks and Regards
Nisheeth
Solved! Go to Solution.
03-07-2024 02:15 AM
Hi,
Quick tip. A simple way to figure out the correct RESTCONF path to access data in NSO CDB from a CLI show command is to pipe the show command to display restconf. Example:
show running-config devices device ORUD0407 config control-plane-group devices device ORUD0407 | display restconf
Regards
03-06-2024 03:58 PM
You have typo in the URL Try this:
curl --location 'http://localhost:8080/restconf/data/tailf-ncs:devices/device=ORUD0407/config/tailf-ned-cisco-staros:context/user-plane-service' \
--header 'Accept: application/yang-data+json' \
--header 'Authorization: Basic ###############################'
03-07-2024 12:13 AM
03-07-2024 02:15 AM
Hi,
Quick tip. A simple way to figure out the correct RESTCONF path to access data in NSO CDB from a CLI show command is to pipe the show command to display restconf. Example:
show running-config devices device ORUD0407 config control-plane-group devices device ORUD0407 | display restconf
Regards
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