07-09-2017 10:46 PM - edited 03-01-2019 03:55 AM
Hi experts,
whether NSO have rest api that could achieve below function ?
admin@ncs(config)# devices device 20.5.30.13 live-status ios-stats:exec show ip inter brief
Load for five secs: 3%/0%; one minute: 6%; five minutes: 9%
Time source is NTP, 13:31:28.063 CST Mon Jul 10 2017
Interface IP-Address OK? Method Status Protocol
Te0/1/0 unassigned YES unset administratively down down
Te0/1/1 unassigned YES unset administratively down down
Te0/1/2 unassigned YES unset administratively down down
Solved! Go to Solution.
07-09-2017 11:08 PM
Have know the answer,
curl -i -u admin:admin -X POST -H "Content-Type: application/vnd.yang.operation+xml" -d '<input><args>cable rpd</args></input>' "http://127.0.0.1:8080/api/operational/devices/device/20.5.30.13/live-status/ios-stats:exec/_operations/show"
HTTP/1.1 200 OK
Server:
Date: Mon, 10 Jul 2017 05:58:49 GMT
Cache-Control: private, no-cache, must-revalidate, proxy-revalidate
Content-Length: 811
Content-Type: application/vnd.yang.operation+xml
Vary: Accept-Encoding
Pragma: no-cache
<output xmlns='urn:ios-stats'>
<result>
Load for five secs: 9%/2%; one minute: 11%; five minutes: 10%
Time source is NTP, 14:01:35.753 CST Mon Jul 10 2017
MAC Address IP Address I/F State Role HA Name
0030.0000.0001 120.104.3.34 Te7/1/0 online Pri Act cpc
2254.0000.0031 120.104.33.31 Te7/1/1 online Pri Act NG03-2254.00...
2254.0000.0033 120.104.33.33 Te7/1/1 online Pri Act NG03-2254.00...
2254.0000.0034 120.104.33.34 Te7/1/1 offline Pri Act NG03-2254.00...
2254.0000.0035 120.104.33.35 Te7/1/1 online Pri Act NG03-2254.00...
2254.0000.0062 120.104.33.62 Te7/1/1 offline Pri Act NG03-2254.00...
07-09-2017 11:08 PM
Have know the answer,
curl -i -u admin:admin -X POST -H "Content-Type: application/vnd.yang.operation+xml" -d '<input><args>cable rpd</args></input>' "http://127.0.0.1:8080/api/operational/devices/device/20.5.30.13/live-status/ios-stats:exec/_operations/show"
HTTP/1.1 200 OK
Server:
Date: Mon, 10 Jul 2017 05:58:49 GMT
Cache-Control: private, no-cache, must-revalidate, proxy-revalidate
Content-Length: 811
Content-Type: application/vnd.yang.operation+xml
Vary: Accept-Encoding
Pragma: no-cache
<output xmlns='urn:ios-stats'>
<result>
Load for five secs: 9%/2%; one minute: 11%; five minutes: 10%
Time source is NTP, 14:01:35.753 CST Mon Jul 10 2017
MAC Address IP Address I/F State Role HA Name
0030.0000.0001 120.104.3.34 Te7/1/0 online Pri Act cpc
2254.0000.0031 120.104.33.31 Te7/1/1 online Pri Act NG03-2254.00...
2254.0000.0033 120.104.33.33 Te7/1/1 online Pri Act NG03-2254.00...
2254.0000.0034 120.104.33.34 Te7/1/1 offline Pri Act NG03-2254.00...
2254.0000.0035 120.104.33.35 Te7/1/1 online Pri Act NG03-2254.00...
2254.0000.0062 120.104.33.62 Te7/1/1 offline Pri Act NG03-2254.00...
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the NSO Developer community: