cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
369
Views
0
Helpful
1
Replies

Rest API about live-status show command execution

haofan
Level 4
Level 4

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   

1 Accepted Solution

Accepted Solutions

haofan
Level 4
Level 4

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>&#13;

Load for five secs: 9%/2%; one minute: 11%; five minutes: 10%&#13;

Time source is NTP, 14:01:35.753 CST Mon Jul 10 2017&#13;

&#13;

MAC Address     IP Address       I/F       State        Role HA  Name           &#13;

0030.0000.0001  120.104.3.34     Te7/1/0   online       Pri  Act cpc            &#13;

2254.0000.0031  120.104.33.31    Te7/1/1   online       Pri  Act NG03-2254.00...&#13;

2254.0000.0033  120.104.33.33    Te7/1/1   online       Pri  Act NG03-2254.00...&#13;

2254.0000.0034  120.104.33.34    Te7/1/1   offline      Pri  Act NG03-2254.00...&#13;

2254.0000.0035  120.104.33.35    Te7/1/1   online       Pri  Act NG03-2254.00...&#13;

2254.0000.0062  120.104.33.62    Te7/1/1   offline      Pri  Act NG03-2254.00...&#13;

&#13;

View solution in original post

1 Reply 1

haofan
Level 4
Level 4

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>&#13;

Load for five secs: 9%/2%; one minute: 11%; five minutes: 10%&#13;

Time source is NTP, 14:01:35.753 CST Mon Jul 10 2017&#13;

&#13;

MAC Address     IP Address       I/F       State        Role HA  Name           &#13;

0030.0000.0001  120.104.3.34     Te7/1/0   online       Pri  Act cpc            &#13;

2254.0000.0031  120.104.33.31    Te7/1/1   online       Pri  Act NG03-2254.00...&#13;

2254.0000.0033  120.104.33.33    Te7/1/1   online       Pri  Act NG03-2254.00...&#13;

2254.0000.0034  120.104.33.34    Te7/1/1   offline      Pri  Act NG03-2254.00...&#13;

2254.0000.0035  120.104.33.35    Te7/1/1   online       Pri  Act NG03-2254.00...&#13;

2254.0000.0062  120.104.33.62    Te7/1/1   offline      Pri  Act NG03-2254.00...&#13;

&#13;

Getting Started

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: