Permalink
Browse files

Document NTPServer system resource

  • Loading branch information...
1 parent 92fe55c commit 8aa2e1d24917b3011791b23d560a8c4a8d2e5848 @william-gr william-gr committed Sep 10, 2013
Showing with 182 additions and 0 deletions.
  1. +182 −0 docs/api/resources/system.rst
@@ -353,3 +353,185 @@ Delete resource
Content-Type: application/json
:statuscode 204: no error
+
+
+NTPServer
+----------
+
+The NTPServer resource represents ntp.conf(5) to configure Network Time Protocol (NTP).
+
+List resource
++++++++++++++
+
+.. http:get:: /api/v1.0/system/ntpserver/
+
+ Returns a list of all ntpservers.
+
+ **Example request**:
+
+ .. sourcecode:: http
+
+ GET /api/v1.0/system/ntpserver/ HTTP/1.1
+ Content-Type: application/json
+
+ **Example response**:
+
+ .. sourcecode:: http
+
+ HTTP/1.1 200 OK
+ Vary: Accept
+ Content-Type: application/json
+
+ [
+ {
+ "ntp_minpoll": 6,
+ "ntp_maxpoll": 9,
+ "ntp_prefer": false,
+ "ntp_address": "0.freebsd.pool.ntp.org",
+ "ntp_burst": false,
+ "id": 1,
+ "ntp_iburst": true
+ },
+ {
+ "ntp_minpoll": 6,
+ "ntp_maxpoll": 9,
+ "ntp_prefer": false,
+ "ntp_address": "1.freebsd.pool.ntp.org",
+ "ntp_burst": false,
+ "id": 2,
+ "ntp_iburst": true
+ },
+ {
+ "ntp_minpoll": 6,
+ "ntp_maxpoll": 9,
+ "ntp_prefer": false,
+ "ntp_address": "2.freebsd.pool.ntp.org",
+ "ntp_burst": false,
+ "id": 3,
+ "ntp_iburst": true
+ }
+ ]
+
+ :query offset: offset number. default is 0
+ :query limit: limit number. default is 30
+ :resheader Content-Type: content type of the response
+ :statuscode 200: no error
+
+
+Create resource
++++++++++++++++
+
+.. http:post:: /api/v1.0/system/ntpserver/
+
+ Creates a new ntpserver and returns the new ntpserver object.
+
+ **Example request**:
+
+ .. sourcecode:: http
+
+ POST /api/v1.0/system/ntpserver/ HTTP/1.1
+ Content-Type: application/json
+
+ {
+ "ntp_address": "br.pool.ntp.org"
+ }
+
+ **Example response**:
+
+ .. sourcecode:: http
+
+ HTTP/1.1 201 Created
+ Vary: Accept
+ Content-Type: application/json
+
+ {
+ "ntp_minpoll": 6,
+ "ntp_maxpoll": 10,
+ "ntp_prefer": false,
+ "ntp_address": "br.pool.ntp.org",
+ "ntp_burst": false,
+ "id": 4,
+ "ntp_iburst": true
+ }
+
+ :json string ntp_minpoll: minimum poll interval as a power of 2 in seconds
+ :json string ntp_maxpoll: maximum poll interval as a power of 2 in seconds
+ :json string ntp_prefer: mark this server as preferred
+ :json string ntp_address: address of the server
+ :json string ntp_burst: send a burst of 8 packets when reachable
+ :json string ntp_iburst: send a burst of 8 packets when unreachable
+ :reqheader Content-Type: the request content type
+ :resheader Content-Type: the response content type
+ :statuscode 201: no error
+
+
+Update resource
++++++++++++++++
+
+.. http:put:: /api/v1.0/system/ntpserver/(int:id)/
+
+ Update ntpserver `id`.
+
+ **Example request**:
+
+ .. sourcecode:: http
+
+ PUT /api/v1.0/system/ntpserver/2/ HTTP/1.1
+ Content-Type: application/json
+
+ {
+ "ntp_prefer": true,
+ }
+
+ **Example response**:
+
+ .. sourcecode:: http
+
+ HTTP/1.1 202 Accepted
+ Vary: Accept
+ Content-Type: application/json
+
+ {
+ "ntp_minpoll": 6,
+ "ntp_maxpoll": 10,
+ "ntp_prefer": true,
+ "ntp_address": "br.pool.ntp.org",
+ "ntp_burst": false,
+ "id": 4,
+ "ntp_iburst": true
+ }
+
+ :json string ntp_minpoll: minimum poll interval as a power of 2 in seconds
+ :json string ntp_maxpoll: maximum poll interval as a power of 2 in seconds
+ :json string ntp_prefer: mark this server as preferred
+ :json string ntp_address: address of the server
+ :json string ntp_burst: send a burst of 8 packets when reachable
+ :json string ntp_iburst: send a burst of 8 packets when unreachable
+ :reqheader Content-Type: the request content type
+ :resheader Content-Type: the response content type
+ :statuscode 202: no error
+
+
+Delete resource
++++++++++++++++
+
+.. http:delete:: /api/v1.0/system/ntpserver/(int:id)/
+
+ Delete ntpserver `id`.
+
+ **Example request**:
+
+ .. sourcecode:: http
+
+ DELETE /api/v1.0/system/ntpserver/2/ HTTP/1.1
+ Content-Type: application/json
+
+ **Example response**:
+
+ .. sourcecode:: http
+
+ HTTP/1.1 204 No Response
+ Vary: Accept
+ Content-Type: application/json
+
+ :statuscode 204: no error

0 comments on commit 8aa2e1d

Please sign in to comment.