FutureNet

NXR,VXRシリーズ

REST-API編

2. メンテナンス

2-12. ping(IPv4)の実行・結果確認(maint/ping)

 処理概要

ping(IPv4)に関する処理を実行します。

 

URIおよびメソッド

機能 Version URI メソッド
POST PUT GET DELETE
ping(IPv4) v2 /api/v2/maint/ping
/api/v2/maint/ping/{ID}

凡例:

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

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

- : 未対応

 

実行例

pingの実行

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

POST /api/v2/maint/ping
Accept: application/json
Content-Type: application/json

 

{
"dst": "192.168.10.10",
"src": "192.168.10.1",
"size": 64,
"count": 4
}

 

レスポンス

202 Accepted
Content-Type: application/json

 

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

 

 

XML
リクエスト

POST /api/v2/maint/ping
Accept: application/xml
Content-Type: application/xml

 

<config>
<dst>192.168.10.10</dst>
<src>192.168.10.1</src>
<size>64</size>
<count>4</count>
</config>

 

レスポンス

202 Accepted
Content-Type: application/xml

 

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

 

pingの実行IDの一覧取得

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

GET /api/v2/maint/ping
Accept: application/json

 

レスポンス

200 OK
Content-Type: application/json

 

{
“exec-id”: [
“1234”,
“5678”
]
}

 

XML
リクエスト

GET /api/v2/maint/ping
Accept: application/xml

 

レスポンス

200 OK
Content-Type: application/xml

 

<ping>
<exec-id>1234</exec-id>
<exec-id>5678</exec-id>
</ping>

 

TEXT/PLAIN
リクエスト

GET /api/v2/maint/ping
Accept: text/plain

 

レスポンス

200 OK
Content-Type: text/plain

 

exec-id : 1234
exec-id : 5678

 

pingの実行(実行ID指定)

メソッド URI
POST /api/v2/maint/ping/{ID}
  • 実行ID(exec-id)は、0000 ~ ffffまでの4桁の16進数を指定。

 

JSON
リクエスト

POST /api/v2/maint/ping/0001
Accept: application/json
Content-Type: application/json

 

{
"dst": "192.168.10.10",
"src": "192.168.10.1",
"size": 64,
"count": 4
}

 

レスポンス

202 Accepted
Content-Type: application/json

 

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

 

 

XML
リクエスト

POST /api/v2/maint/ping/0001
Accept: application/xml
Content-Type: application/xml

 

<config>
<dst>192.168.10.10</dst>
<src>192.168.10.1</src>
<size>64</size>
<count>4</count>
</config>

 

レスポンス

202 Accepted
Content-Type: application/xml

 

<ping>
<exec-id>0001</exec-id>
<expire>600</expire>
</ping>

 

pingの実行結果の取得

メソッド URI
GET /api/v2/maint/ping/{ID}
  • 実行ID(exec-id)は、0000 ~ ffffまでの4桁の16進数を指定。

 

TEXT/PLAIN
リクエスト

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

 

レスポンス

200 OK
Content-Type: text/plain

 

[started: 2023/03/03 12:01:52]
PING 192.168.10.10 (192.168.10.10) from 192.168.10.1 : 64(92) bytes of data.
72 bytes from 192.168.10.10: icmp_seq=1 ttl=64 time=0.981 ms
72 bytes from 192.168.10.10: icmp_seq=2 ttl=64 time=0.343 ms
72 bytes from 192.168.10.10: icmp_seq=3 ttl=64 time=0.300 ms
72 bytes from 192.168.10.10: icmp_seq=4 ttl=64 time=0.223 ms

— 192.168.10.10 ping statistics —
4 packets transmitted, 4 received, 0% packet loss, time 3026ms
rtt min/avg/max/mdev = 0.223/0.461/0.981/0.303 ms

 

pingの実行停止・結果の削除

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

DELETE /api/v2/maint/ping/0001

 

レスポンス

204 No content

 

パラメータ

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

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

  • パラメータ表の説明文中の表記について
    < > … 括弧内の値の範囲から選択することを示しています。
    [ ] … 括弧内の値のどれかを選択することを示しています。
    数字,文字列 … 初期値
  • パラメータ表の説明文中のデータタイプについて
    A.B.C.D … IPv4アドレス
    FQDN … FQDN名(ex. test.example.com)

 

パラメータおよびレベル 説明
Lv.1 Lv.2
config dst 宛先アドレス …

  • A.B.C.D
  • FQDN
src 送信元IPアドレス … A.B.C.D
※interfaceとの同時指定不可。同時指定時はsrc設定が優先
interface 送信元インタフェース名(ex. ethernet0, ethernet0.Y 〔YはVLAN ID〕)
※srcとの同時指定不可。同時指定時はsrc設定が優先
count 送信回数 … <1-256(10)>
wait 待ち時間 … <1-30(10)>(sec)
interval 送信間隔 … <0-10(1)>(sec)
tos ToS … <0-255>
size 送信サイズ … <36-18024(56)>(bytes)
df-bit DF bit … [ on | off ]