- FutureNet製品活用ガイド
- FutureNet NXR,VXRシリーズ
- REST-API編
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の実行
※読み取り専用ユーザは実行できません。
- reset mobileコマンドの実行
- reset poe ethernetコマンドの実行
- reset simコマンドの実行
- reset netevent trackコマンドの実行
- reset netevent trackコマンド(timer指定)の実行
- get system statistics cpuコマンドの実行
- clear ip bgpコマンドの実行
- clear dumpコマンドの実行
- delete dumpコマンドの実行
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
目次
- 1. REST-API機能の利用方法およびAuth-IDの発行
- 2. メンテナンス
- メンテナンス一覧
- 2-1. 機器再起動(maint/restart)
- 2-2. 設定の保存(maint/save-config)
- 2-3. 各種コピー操作(maint/copy)
- 2-4. startup-configの保存・取得(maint/startup-config)
- 2-5. ファームウェアの更新(maint/firmware/update)
- 2-6. ファームウェアリストアップデートでの更新(maint/firmware/list-update)
- 2-7. ファームウェアバージョンの取得(maint/firmware/version)
- 2-8. exec系,showコマンドの実行(maint/cli)
- 2-9. configの反映・取得(maint/config)
- 2-10. ロールバックの実行・ロールバック用コマンドの確認(maint/rollback-config)
- 2-11. ロールバックタイマの取得・停止(maint/rollback-timer)
- 2-12. ping(IPv4)の実行・結果確認(maint/ping)
- 2-13. Ping(IPv6)の実行・結果確認(maint/ping6)
- 2-14. traceroute(IPv4)の実行・結果確認(maint/traceroute)
- 2-15. traceroute(IPv6)の実行・結果確認(maint/traceroute6)
- 2-16. パケットダンプの実行・結果確認(maint/dump)
- 2-17. デバッグタイマの実行(maint/debug)
- 2-18. センチュリー・テクニカルサポート情報の取得(maint/century-tech-support)
- 3. インタフェース設定
- 4. ルーティング設定
- 5. アクセスリスト設定
- 6. NAT設定
- 7. VPN設定
- 8. 各種サービス設定
- 9. ネットイベント設定
- 10. モバイル・WiFi設定
- 11. IPv4/IPv6設定
- 12. システム設定
更新情報
→ 一覧へカテゴリ
タグ
- CRG
- DDNS
- DHCP
- DNAT
- DNSインターセプト
- Ethernet
- IIJモバイル
- IKE Modeconfig
- IKEv2 Configuration Payload
- IPinIP
- IPoE
- IPv6
- KDDI
- L2TPv3
- MAP-E
- NGN
- NTTドコモ
- PBR
- Policy Based IPsec
- PPP
- PPPoE
- QoS
- RADIUS連携
- RAシリーズ
- Route Based IPsec
- SMS
- SNAT
- SoftBank
- UPnP
- URL転送
- VLAN
- VRRP
- Web認証
- WiMAX
- コンフィグロールバック
- ネットイベント
- フィルタ
- ブリッジ
- モニタログ
- ワイモバイル
- 仮想スイッチ
- 冗長化
- 無線LAN