cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
335
Views
1
Helpful
3
Replies
Cisco Employee

Query NSO via REST API for Operational data

 

Hi folks,

 

 

I know we can use JSON RPC to query devices for live-status information that is not stored in CDB. Is there an equivalent way to obtain this information via REST API ?

 

 

  1. E.g. of the NSO CLI for gathering live-status command on a device:

 

 

admin@ncs> show devices device CBP62BBSAA02 live-status system information

 

 

Response:

 

 

live-status system information system-name <customer device name removed>

 

live-status system information chassis-type "7750 SR-c12"

 

live-status system information software-version B-12.0.R9

 

live-status system information system-up-time "7 days"

 

live-status system information last-time-configuration-saved "2016/04/28 15:30:38"

 

3 REPLIES 3
Highlighted
Cisco Employee

Re: Query NSO via REST API for Operational data

 

Hey Nick,

 

 

I would expect this is possible, I have used actions over REST quite a bit. I don’t have environment handy to check your specific request, but see below a REST call for a RPC-Ping on a JunOS box:

 

 

Post to:

 

 

/api/running/devices/device/VICPE1/rpc/jrpc:rpc-ping/_operations/ping/

 

 

Content:

 

 

 

   "ping":{

 

      "host":"10.255.255.1"

 

     }

 

}

 

 

NCS CLI equivalent is :

 

 

admin@ncs> request devices device VICPE1 ping 10.255.255.1

 

 

 

Hope this helps!

 

 

cheers,

 

  1. Dan.

 

Highlighted
Cisco Employee

Re: Query NSO via REST API for Operational data

 

Hi Nick,

 

I used a GET at URL

 

http://localhost:8080/api/operational/devices/device/alu7750-a/live-status/system/information

 

 

Response was:

 

<information xmlns="http://tail-f.com/ned/alu-sr/stats" xmlns:y="http://tail-f.com/ns/rest"  xmlns:alu-stats="http://tail-f.com/ned/alu-sr/stats"  xmlns:ncs="http://tail-f.com/ns/ncs">

 

    <system-name>NS042550171</system-name>

 

    <chassis-type>7750 SR-7</chassis-type>

 

    <software-version>C-12.0.R8</software-version>

 

    <system-up-time>231 days</system-up-time>

 

    <last-time-configuration-saved>2000/08/19 05:40:10</last-time-configuration-saved>

 

    <last-user-to-modify-configuration>admin</last-user-to-modify-configuration>

 

</information>

 

 

Cheers

 

Stefano

 

Highlighted
Cisco Employee

Re: Query NSO via REST API for Operational data

 

Nick, check here, an existing community thread which has an example of executing a live-status command through rest (from Mike Leske).

 

 

Thanks!

 

This widget could not be displayed.