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

JSON formatted response to Action

Fantolino
Level 1
Level 1

I need to gather info produced via an NSO Action using JSON formatting.

CLI commands response seems to me not a correct JSON text, as you can see below (a list of value should be reported as array).

cisco@ncs> request Nsdwan CheckSite Tir hcw2 | display json
{
"esito": "success",
"StatoSuController": {
. . .
"af1": {
"nbarCat": "browsing", "business-and-productivity-tools", "backup-and-storage", "epayement",
. . .

I actually need to gather the response via an HTTP POST request using the body below reported

{"jsonrpc":"2.0","id":1,"method":"run_action","params":{"path":"/timsdn-nsdwan:Nsdwan/timsdn-nsdwan:CheckSite","params":{"Tir":"hcw2","Site":"A46bf8024-7934-11ec-b2ce-005056b81955","noSync":""},"th":1}}

How can I request to get the response as JSON?

2 Replies 2

jvikman
Cisco Employee
Cisco Employee

You should get the results to a JSON-RPC in JSON. What do you get when you try that?

jvikman
Cisco Employee
Cisco Employee

Is the "nbarCat" a leaf-list?