- 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 コマンドの実行
- speed-test コマンドの実行
- dio output コマンドの実行
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
speed-test コマンドの実行(JSON)
リクエスト
POST /api/v2/maint/cli
Accept: application/json
Content-Type: application/json
{
"exec" : "speed-test 1 start"
}
レスポンス
202 Accepted
Content-Type: application/json
{
"exec-id": "1234",
"expire": 600
}
speed-test コマンドの実行(XML)
リクエスト
POST /api/v2/maint/cli
Accept: application/xml
Content-Type: application/xml
<config>
<exec>speed-test 1 start</exec>
</config>
レスポンス
202 Accepted
Content-Type: application/xml
dio output コマンドの実行(JSON)
リクエスト
POST /api/v2/maint/cli
Accept: application/json
Content-Type: application/json
{
"exec" : "dio output 1 on"
}
レスポンス
200 OK
dio output コマンドの実行(XML)
リクエスト
POST /api/v2/maint/cli
Accept: application/xml
Content-Type: application/xml
<config>
<exec>dio output 1 on</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
CLI 実行結果の取得(非同期コマンド用)
本 API は、実行に時間を要するため非同期で処理される CLI コマンドについて、その実行結果を取得するために使用します。
処理の流れ
- 任意の CLI 実行 API を呼び出し、レスポンスとして 実行 ID(exec-id) を取得する。
- 本 API(GET)に実行 ID を渡して、コマンドの実行結果を確認する。
| メソッド | URI |
| GET | /api/v2/maint/cli/{ID} |
- 実行 ID(exec-id)は、0000 ~ ffff(4桁の16進数)で指定します。
- 実行結果の保持期間は、コマンド完了から 600 秒間 です。時間を過ぎると ID は無効となり削除されます。
- speed-test コマンドの制限:
本 API で取得できるのは、「コマンドの実行状態(実行中・終了・エラー等)」のみです。スループット等の測定データ(測定結果)を取得する場合は、PUT /maint/cli を別途使用してください。
TEXT/PLAIN
リクエスト
GET /api/v2/maint/cli/0001
Accept: text/plain
レスポンス
200 OK
Content-Type: text/plain
- 出力例 1 : get system statistics cpu
[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
- 出力例 2 : speed-test
[started: 2026/01/15 17:13:57] Starting .... finished(seq number 1)
CLI 実行の停止・実行結果の削除(非同期コマンド用)
| メソッド | 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. システム設定
更新情報
→ 一覧へ- 2026.03.10CB
CB-230編
1.1 CB-230 シリアルポートからのアラーム(バッテリー電圧異常)を受けてMAをシャットダウンさせる - 2026.03.05NXR,VXR
REST-API編
2-8. exec系,showコマンドの実行(maint/cli) - 2026.01.20NXR,VXR
無線LAN編
5-6. 無線 LAN 設定(802.11ax/6 GHz/RADIUS) - 2026.01.15NXR,VXR
無線LAN編
5-5. 無線 LAN 設定(802.11ax/5 GHz/VAP/MACフィルタリング) - 2026.01.15NXR,VXR
無線LAN編
5-4. 無線 LAN 設定(802.11ax/5 GHz/VAP)
カテゴリ
タグ
- 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
