FutureNet

NXR,VXRシリーズ

REST-API編

2. メンテナンス

2-8. exec系,showコマンドの実行(maint/cli)

 処理概要

exec系,showコマンドに関する処理を実行します。

 

URIおよびメソッド

機能 Version URI メソッド
POST PUT GET DELETE
CLI v1 /api/v1/maint/cli
v2 /api/v2/maint/cli
/api/v2/maint/cli/{ID}

凡例:

● : 読み取り専用ユーザも含めアクセス可

〇 : 読み取り専用ユーザはアクセス不可

- : 未対応

※ NXR-G100シリーズ以外の機種ではREST-APIv2の利用を推奨します。

 

実行例

exec系コマンドの実行

メソッド URI
POST /api/v2/maint/cli

 

 

reset interface ethernetの実行(JSON)
リクエスト

POST /api/v2/maint/cli
Content-Type: application/json

 

{
"exec" : "reset interface ethernet 0"
}

 

レスポンス

200 OK

 

reset interface ethernetの実行(XML)
リクエスト

POST /api/v2/maint/cli
Content-Type: application/xml

 

<config>
<exec>reset interface ethernet 0</exec>
</config>

 

レスポンス

200 OK

 

reset mobileコマンドの実行(JSON)
リクエスト

POST /api/v2/maint/cli
Content-Type: application/json

 

{
"exec" : "reset mobile 1"
}

 

レスポンス

200 OK

 

reset mobileコマンドの実行(XML)
リクエスト

POST /api/v2/maint/cli
Content-Type: application/xml

 

<config>
<exec>reset mobile 1</exec>
</config>

 

レスポンス

200 OK

 

reset poe ethernetコマンドの実行(JSON)
リクエスト

POST /api/v2/maint/cli
Content-Type: application/json

 

{
"exec" : "reset poe ethernet 0 enable"
}

 

レスポンス

200 OK

 

reset poe ethernetコマンドの実行(XML)
リクエスト

POST /api/v2/maint/cli
Content-Type: application/xml

 

<config>
<exec>reset poe ethernet 0 disable</exec>
</config>

 

レスポンス

200 OK

 

reset simコマンドの実行(JSON)
リクエスト

POST /api/v2/maint/cli
Content-Type: application/json

 

{
"exec" : "reset sim mobile 2 otherslot"
}

 

レスポンス

200 OK

 

reset simコマンドの実行(XML)
リクエスト

POST /api/v2/maint/cli
Content-Type: application/xml

 

<config>
<exec>reset sim mobile 2 otherslot</exec>
</config>

 

レスポンス

200 OK

 

reset netevent trackコマンドの実行(JSON)
リクエスト

POST /api/v2/maint/cli
Content-Type: application/json

 

{
"exec" : "reset netevent track 255 down"
}

 

レスポンス

200 OK

 

reset netevent trackコマンドの実行(XML)
リクエスト

POST /api/v2/maint/cli
Content-Type: application/xml

 

<config>
<exec>reset netevent track 255 up</exec>
</config>

 

レスポンス

200 OK

 

reset netevent trackコマンド(timer指定)の実行(JSON)
リクエスト

POST /api/v2/maint/cli
Content-Type: application/json

 

{
"exec" : "reset netevent track 255 down timer 30"
}

 

レスポンス

200 OK

 

reset netevent trackコマンド(timer指定)の実行(XML)
リクエスト

POST /api/v2/maint/cli
Content-Type: application/xml

 

<config>
<exec>reset netevent track 255 down timer 00:01:00</exec>
</config>

 

レスポンス

200 OK

 

get system statistics cpuコマンドの実行(JSON)
リクエスト

POST /api/v2/maint/cli
Content-Type: application/json

 

{
"exec" : "get system statistics cpu all 1 10"
}

 

レスポンス

202 Accepted
Content-Type: application/json

 

{
"exec-id": "1234",
"expire": 600
}

 

get system statistics cpuコマンドの実行(XML)
リクエスト

POST /api/v2/maint/cli
Content-Type: application/xml

 

<config>
<exec>get system statistics cpu all 1 10</exec>
</config>

 

レスポンス

202 Accepted
Content-Type: application/xml

 

<cli>
<exec-id>1234</exec-id>
<expire>600</expire>
</cli>

 

clear ip bgpコマンドの実行(JSON)
リクエスト

POST /api/v2/maint/cli
Content-Type: application/json

 

{
"exec" : "clear ip bgp *"
}

 

レスポンス

200 OK

 

clear ip bgpコマンドの実行(XML)
リクエスト

POST /api/v2/maint/cli
Content-Type: application/xml

 

<config>
<exec>clear ip bgp *</exec>
</config>

 

レスポンス

200 OK

 

clear dumpコマンドの実行(JSON)
リクエスト

POST /api/v2/maint/cli
Content-Type: application/json

 

{
"exec" : "clear dump"
}

 

レスポンス

200 OK

 

clear dumpコマンドの実行(XML)
リクエスト

POST /api/v2/maint/cli
Content-Type: application/xml

 

<config>
<exec>clear dump</exec>
</config>

 

レスポンス

200 OK

 

delete dumpコマンドの実行(JSON)
リクエスト

POST /api/v2/maint/cli
Content-Type: application/json

 

{
"exec" : "delete dump"
}

 

レスポンス

200 OK

 

delete dumpコマンドの実行(XML)
リクエスト

POST /api/v2/maint/cli
Content-Type: application/xml

 

<config>
<exec>delete dump</exec>
</config>

 

レスポンス

200 OK

 

showコマンドの実行

メソッド URI
PUT /api/{VERSION}/maint/cli

※show syslog message monitorコマンドは実行できません。

 

 

include指定なし(JSON)
リクエスト

PUT /api/v2/maint/cli
Accept: text/plain
Content-Type: application/json

 


{
"show": "mobile 1 signal-info"
}

 

レスポンス

200 OK
Content-Type: text/plain

 

BAND : 1 (2100 MHz)
Cell ID : 1a0
RSRP : -101dBm
RSRQ : -15dB
RSSI : -65dBm
SINR : -1dB
TAC : 35105

 

include指定なし(XML)
リクエスト

PUT /api/v2/maint/cli
Accept: text/plain
Content-Type: application/xml

 

<config>
<show>mobile 1 signal-info</show>
</config>

 

レスポンス

200 OK
Content-Type: text/plain

 

BAND : 1 (2100 MHz)
Cell ID : 1a0
RSRP : -101dBm
RSRQ : -15dB
RSSI : -65dBm
SINR : -1dB
TAC : 35105

 

include指定あり(JSON)
リクエスト

PUT /api/v2/maint/cli
Accept: text/plain
Content-Type: application/json

 


{
"show": "interface ethernet 0",
"include": "inet addr"
}

 

レスポンス

200 OK
Content-Type: text/plain

 

inet addr:192.168.0.254 Bcast:192.168.0.255 Mask:255.255.255.0

 

include指定あり(XML)
リクエスト

PUT /api/v2/maint/cli
Accept: text/plain
Content-Type: application/xml

 

<config>
<show>interface ethernet 0</show>
<include>inet addr</include>
</config>

 

レスポンス

200 OK
Content-Type: text/plain

 

inet addr:192.168.0.254 Bcast:192.168.0.255 Mask:255.255.255.0

 

get system statistics cpuコマンドの実行結果の取得

メソッド URI
GET /api/v2/maint/cli/{ID}
  • 実行ID(exec-id)は、0000 ~ ffffまでの4桁の16進数を指定。
  • 実行結果は600秒後に消去されます。

 

TEXT/PLAIN
リクエスト

GET /api/v2/maint/cli/0001
Accept: text/plain

 

レスポンス

200 OK
Content-Type: text/plain

 

[started: 2023/05/09 12:32:15]
 12:32:15   CPU#     %CPU    %user   %nice   %system     %idle   %iowait    %irq    %soft
 12:32:16    all     0.00     0.00    0.00      0.00    100.00      0.00    0.00     0.00
 12:32:16      0     0.00     0.00    0.00      0.00    100.00      0.00    0.00     0.00
 12:32:16      1     0.00     0.00    0.00      0.00    100.00      0.00    0.00     0.00
 12:32:17    all     0.00     0.00    0.00      0.00    100.00      0.00    0.00     0.00
 12:32:17      0     0.00     0.00    0.00      0.00    100.00      0.00    0.00     0.00
 12:32:17      1     0.00     0.00    0.00      0.00    100.00      0.00    0.00     0.00
 12:32:18    all     0.00     0.00    0.00      0.00    100.00      0.00    0.00     0.00
 12:32:18      0     0.00     0.00    0.00      0.00    100.00      0.00    0.00     0.00
 12:32:18      1     0.00     0.00    0.00      0.00    100.00      0.00    0.00     0.00
 12:32:19    all     0.00     0.00    0.00      0.00    100.00      0.00    0.00     0.00
 12:32:19      0     0.00     0.00    0.00      0.00    100.00      0.00    0.00     0.00
 12:32:19      1     0.00     0.00    0.00      0.00    100.00      0.00    0.00     0.00
 12:32:20    all     0.00     0.00    0.00      0.00    100.00      0.00    0.00     0.00
 12:32:20      0     0.00     0.00    0.00      0.00    100.00      0.00    0.00     0.00
 12:32:20      1     0.00     0.00    0.00      0.00    100.00      0.00    0.00     0.00
 AVERAGE     all     0.00     0.00    0.00      0.00    100.00      0.00    0.00     0.00
 AVERAGE       0     0.00     0.00    0.00      0.00    100.00      0.00    0.00     0.00
 AVERAGE       1     0.00     0.00    0.00      0.00    100.00      0.00    0.00     0.00

get system statistics cpuコマンドの実行停止・結果の削除

メソッド URI
DELETE /api/v2/maint/cli/{ID}
リクエスト

DELETE /api/v2/maint/cli/0001

 

レスポンス

204 No content

目次