FutureNet

NXR,VXRシリーズ

REST-API編

8. 各種サービス設定

8-6. UPnP設定(upnp)

 処理概要

UPnP設定に関する処理を実行します。

 

URIおよびメソッド

機能 Version URI メソッド
POST PUT GET DELETE
UPnP v2 /api/v2/upnp

凡例:

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

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

- : 未対応

 

実行例

UPnP設定の作成

メソッド URI
POST /api/v2/upnp
JSON
リクエスト

POST /api/v2/upnp
Content-Type: application/json

 

{
"service": "enable",
"external": "ethernet1",
"listen": "192.168.0.254/24",
"timeout": 3600
}

 

レスポンス

201 Created

 

XML
リクエスト

POST /api/v2/upnp
Content-Type: application/xml

 

<upnp>
<service>enable</service>
<external>ethernet1</external>
<listen>192.168.0.254/24</listen>
<timeout>3600</timeout>
</upnp>

 

レスポンス

201 Created

 

UPnP設定の更新

メソッド URI
PUT /api/v2/upnp
JSON
リクエスト

PUT /api/v2/upnp
Content-Type: application/json

 

{
"service": "enable",
"external": "ethernet1",
"listen": "192.168.0.254/24",
"timeout": 3600,
"port-reserve": {
"min": 10000
}
}

 

レスポンス

204 No content

 

XML
リクエスト

PUT /api/v2/upnp
Content-Type: application/xml

 

<upnp>
<service>enable</service>
<external>ethernet1</external>
<listen>192.168.0.254/24</listen>
<timeout>3600</timeout>
<port-reserve>
<min>10000</min>
</port-reserve>
</upnp>

 

レスポンス

204 No content

 

UPnP設定の取得

メソッド URI
GET /api/v2/upnp
JSON
リクエスト

GET /api/v2/upnp
Accept: application/json

 

レスポンス

200 OK
Content-Type: application/json

 

{
"service": "enable",
"external": "ethernet1",
"listen": "192.168.0.254/24",
"timeout": 3600,
"port-reserve": {
"min": 10000
}
}

 

XML
リクエスト

GET /api/v2/upnp
Accept: application/xml

 

レスポンス

200 OK
Content-Type: application/xml

 

<upnp>
<service>enable</service>
<external>ethernet1</external>
<listen>192.168.0.254/24</listen>
<timeout>3600</timeout>
<port-reserve>
<min>10000</min>
</port-reserve>
</upnp>

 

TEXT/PLAIN
リクエスト

GET /api/v2/upnp
Accept: text/plain

 

レスポンス

200 OK
Content-Type: text/plain

 

upnp
service enable
external interface ethernet 1
external port-reserve 10000
listen ip 192.168.0.254/24
timeout 3600

 

UPnP設定の削除

メソッド URI
DELETE /api/v2/upnp
リクエスト

DELETE /api/v2/upnp

 

レスポンス

204 No content

 

パラメータ

指定可能なパラメータは下記の通りです。

なお、指定可能なパラメータは製品およびファームウェアのバージョンにより異なりますので、各パラメータの詳細については各製品のユーザーズガイド(CLI版)も合わせてご参照ください。

  • パラメータ表の説明文中の表記について
    < > … 括弧内の値の範囲から選択することを示しています。
    [ ] … 括弧内の値のどれかを選択することを示しています。
    数字,文字列 … 初期値
  • パラメータ表の説明文中のデータタイプについて
    A.B.C.D/M … IPv4プレフィックスおよびマスク長

 

パラメータおよびレベル 説明
Lv.1 Lv.2 Lv.3
upnp service UPnP機能 … [ enable | disable ]
external インタフェース名(ex. ethernet0)
port-reserve min 最小UPnP割り当て禁止ポート番号 … <1-65535>
max 最大UPnP割り当て禁止ポート番号 … <1-65535>
listen Listen IPアドレス … A.B.C.D/M
timeout ポートマッピングタイムアウト時間 … <60-21474836(600)>(sec)
well-known-port well-knownポートへの割り当て … [ enable | disable ]