FutureNet

NXR,VXRシリーズ

REST-API編

8. 各種サービス設定

8-28. リバースSSHトンネル設定(reverse-ssh)

 処理概要

リバースSSHトンネル設定に関する処理を実行します。

 

URIおよびメソッド

機能 Version URI メソッド
POST PUT GET DELETE
Reverse
SSH Tunnel
v2 /api/v2/reverse-ssh
/api/v2/reverse-ssh/tunnel
/api/v2/reverse-ssh/tunnel/{NUM}

凡例:〇対応、-未対応

  • api/v1は対応していません。

 

実行例

リバースSSHトンネル設定の作成

メソッド URI
POST /api/v2/reverse-ssh/tunnel
JSON
リクエスト

POST /api/v2/reverse-ssh/tunnel
Content-Type: application/json

 

{
"tunnel": {
"number": 1,
"server": {
"address": "192.168.10.100"
},
"connection": {
"local": {
"port": 22
},
"remote": {
"port": 5000
}
},
"account": {
"username": "test",
"password": {
"passphrase": "testpass"
}
}
}
}

 

レスポンス

201 Created

 

XML
リクエスト

POST /api/v2/reverse-ssh/tunnel
Content-Type: application/xml

 

<reverse-ssh>
<tunnel>
<number>1</number>
<server>
<address>192.168.10.100</address>
</server>
<connection>
<local>
<port>22</port>
</local>
<remote>
<port>5000</port>
</remote>
</connection>
<account>
<username>test</username>
<password>
<passphrase>testpass</passphrase>
</password>
</account>
</tunnel>
</reverse-ssh>

 

レスポンス

201 Created

 

全リバースSSHトンネル設定の取得

メソッド URI
GET /api/v2/reverse-ssh/tunnel
JSON
リクエスト

GET /api/v2/reverse-ssh/tunnel
Accept: application/json

 

レスポンス

200 OK
Content-Type: application/json

 

{
"tunnel": [
{
"number": 1,
"server": {
"address": "192.168.10.100"
},
"connection": {
"local": {
"port": 22
},
"remote": {
"port": 5000
}
},
"account": {
"username": "test",
"password": {
"passphrase": "testpass"
}
}
},
{
"number": 2,
"server": {
"address": "192.168.10.101"
},
"connection": {
"local": {
"port": 22
},
"remote": {
"port": 5001
}
},
"account": {
"username": "test2",
"password": {
"passphrase": "test2pass"
}
}
}
]
}

 

XML
リクエスト

GET /api/v2/reverse-ssh/tunnel
Accept: application/xml

 

レスポンス

200 OK
Content-Type: application/xml

 

<reverse-ssh>
<tunnel>
<number>1</number>
<server>
<address>192.168.10.100</address>
</server>
<connection>
<local>
<port>22</port>
</local>
<remote>
<port>5000</port>
</remote>
</connection>
<account>
<username>test</username>
<password>
<passphrase>testpass</passphrase>
</password>
</account>
</tunnel>
<tunnel>
<number>2</number>
<server>
<address>192.168.10.101</address>
</server>
<connection>
<local>
<port>22</port>
</local>
<remote>
<port>5001</port>
</remote>
</connection>
<account>
<username>test2</username>
<password>
<passphrase>test2pass</passphrase>
</password>
</account>
</tunnel>
</reverse-ssh>

 

TEXT/PLAIN
リクエスト

GET /api/v2/reverse-ssh/tunnel
Accept: text/plain

 

レスポンス

200 OK
Content-Type: text/plain

 

reverse-ssh
tunnel 1
server 192.168.10.100
account username test password testpass
local port 22 remote port 5000
exit-tunnel
tunnel 2
server 192.168.10.101
account username test2 password test2pass
local port 22 remote port 5001
exit-tunnel
exit

 

リバースSSHトンネル設定の更新

メソッド URI
PUT /api/v2/reverse-ssh/tunnel/{NUM}
JSON
リクエスト

PUT /api/v2/reverse-ssh/tunnel/1
Content-Type: application/json

 

{
"number": 1,
"server": {
"address": "192.168.10.100"
},
"connection": {
"local": {
"port": 22222
},
"remote": {
"port": 5000
}
},
"account": {
"username": "test",
"password": {
"passphrase": "testpass"
}
}
}

 

レスポンス

204 No content

 

XML
リクエスト

PUT /api/v2/reverse-ssh/tunnel/1
Content-Type: application/xml

 

<tunnel>
<number>1</number>
<server>
<address>192.168.10.100</address>
</server>
<connection>
<local>
<port>22222</port>
</local>
<remote>
<port>5000</port>
</remote>
</connection>
<account>
<username>test</username>
<password>
<passphrase>testpass</passphrase>
</password>
</account>
</tunnel>

 

レスポンス

204 No content

 

リバースSSHトンネル設定の取得

メソッド URI
GET /api/v2/reverse-ssh/tunnel/{NUM}
JSON
リクエスト

GET /api/v2/reverse-ssh/tunnel/1
Accept: application/json

 

レスポンス

200 OK
Content-Type: application/json

 

{
"number": 1,
"server": {
"address": "192.168.10.100"
},
"connection": {
"local": {
"port": 22
},
"remote": {
"port": 5000
}
},
"account": {
"username": "test",
"password": {
"passphrase": "testpass"
}
}
}

 

XML
リクエスト

GET /api/v2/reverse-ssh/tunnel/1
Accept: application/xml

 

レスポンス

200 OK
Content-Type: application/xml

 

<tunnel>
<number>1</number>
<server>
<address>192.168.10.100</address>
</server>
<connection>
<local>
<port>22</port>
</local>
<remote>
<port>5000</port>
</remote>
</connection>
<account>
<username>test</username>
<password>
<passphrase>testpass</passphrase>
</password>
</account>
</tunnel>

 

TEXT/PLAIN
リクエスト

GET /api/v2/reverse-ssh/tunnel/1
Accept: text/plain

 

レスポンス

200 OK
Content-Type: text/plain

 

reverse-ssh
tunnel 1
server 192.168.10.100
account username test password testpass
local port 22 remote port 5000
exit-tunnel
exit

 

リバースSSHトンネル設定の削除

メソッド URI
DELETE /api/v2/reverse-ssh/tunnel/{NUM}
リクエスト

DELETE /api/v2/reverse-ssh/tunnel/1

 

レスポンス

204 No content

 

パラメータ

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

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

  • パラメータ表の説明文中の記号について
    < > … 括弧内の値の範囲から選択することを示しています。
    [ ] … 括弧内の値のどれかを選択することを示しています。
  • パラメータ表の説明文中のデータタイプについて
    A.B.C.D … IPv4アドレス
    X:X::X:X … IPv6アドレス

 

パラメータおよびレベル 説明
Lv.1 Lv.2 Lv.3 Lv.4 Lv.5
reverse-ssh tunnel number SSHトンネル番号
server address SSHサーバアドレス …

  • A.B.C.D
  • X:X::X:X
port ポート番号 … <1-65535>
keepalive interval キープアライブ間隔 … <10-600>
count キープアライブ回数 … <1-30>
account username ユーザ名
password hidden 暗号化 … [enable | disable]
passphrase パスワード
connection local port ローカル側SSHポート番号 … <1-65535>
address ローカル側SSHアドレス …

  • A.B.C.D
  • X:X::X:X
remote port リモート側SSHポート番号 … <1-65535>
address リモート側SSHアドレス …

  • A.B.C.D
  • X:X::X:X