FutureNet

NXR,VXRシリーズ

REST-API編

8. 各種サービス設定

8-3. NTP設定(ntp)

 処理概要

NTPサーバ設定に関する処理を実行します。

 

URIおよびメソッド

機能 Version URI メソッド
POST PUT GET DELETE
NTP v2 /api/v2/ntp

凡例:

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

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

- : 未対応

 

実行例

NTPサーバ設定の作成

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

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

 

{
"service": "enable",
"server": {
"address": "203.0.113.1",
"polling": {
"min": 4,
"max": 5
}
}
}

 

レスポンス

201 Created

 

XML
リクエスト

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

 

<ntp>
<service>enable</service>
<server>
<address>203.0.113.1</address>
<polling>
<min>4</min>
<max>5</max>
</polling>
</server>
</ntp>

 

レスポンス

201 Created

 

NTPサーバ設定の更新

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

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

 

{
"service": "enable",
"server": [
{
"address": "203.0.113.1",
"polling": {
"min": 4,
"max": 5
}
},
{
"address": "203.0.113.2",
"polling": {
"min": 4,
"max": 5
}
}
]
}

 

レスポンス

204 No content

 

XML
リクエスト

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

 

<ntp>
<service>enable</service>
<server>
<address>203.0.113.1</address>
<polling>
<min>4</min>
<max>5</max>
</polling>
</server>
<server>
<address>203.0.113.2</address>
<polling>
<min>4</min>
<max>5</max>
</polling>
</server>
</ntp>

 

レスポンス

204 No content

 

NTPサーバ設定の取得

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

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

 

レスポンス

200 OK
Content-Type: application/json

 

{
"service": "enable",
"server": [
{
"address": "203.0.113.1",
"polling": {
"min": 4,
"max": 5
}
},
{
"address": "203.0.113.2",
"polling": {
"min": 4,
"max": 5
}
}
]
}

 

XML
リクエスト

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

 

レスポンス

200 OK
Content-Type: application/xml

 

<ntp>
<service>enable</service>
<server>
<address>203.0.113.1</address>
<polling>
<min>4</min>
<max>5</max>
</polling>
</server>
<server>
<address>203.0.113.2</address>
<polling>
<min>4</min>
<max>5</max>
</polling>
</server>
</ntp>

 

TEXT/PLAIN
リクエスト

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

 

レスポンス

200 OK
Content-Type: text/plain

 

ntp
service enable
server 203.0.113.1 polling 4 5
server 203.0.113.2 polling 4 5

 

NTPサーバ設定の削除

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

DELETE /api/v2/ntp

 

レスポンス

204 No content

 

パラメータ

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

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

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

 

パラメータおよびレベル 説明
Lv.1 Lv.2 Lv.3 Lv.4
ntp service NTP機能 … [ enable | disable ]
server address NTPサーバアドレス …

  • A.B.C.D
  • X:X::X:X
  • FQDN
polling min 最小ポーリング時間 … <4-16>
max 最大ポーリング時間 … <5-17>
timeout タイムアウト時間 … <1-30>(sec)
master ローカルサーバ時のStratum … <1-15(10)>
disable 時刻同期無効 … [ ip | ipv6 ]