The information contained in this document is subject to change. This document contains proprietary information, which is protected by copyright
laws. All rights are reserved. No part of this document may be photocopied, reproduced or translated to another language or program language
without prior written consent of RFI Engineering B.V.
RefGuide_U-routerNGW_v1.01.docx
Page: 56(
57)
14.13 Timeserver
The ‘
timeserver
’ endpoints provide information the status and the configuration of the time
server on the U-router NGW.
ENDPOINTS
GET /api/timeserver
POST /api/timeserver
You can use the
GET /api/timeserser
endpoint to retrieve the status and configuration of the time
server on the system.
For example:
curl https://192.168.168.1/api/timeserver -u rfi:rfi123
Returns:
{
"timeserver": {
"enabled": "1",
"state": "up",
"config_txt": "# This file is part of systemd.\n#\n# systemd is free software; you
can redistribute it and/or modify it\n# under the terms of the GNU Lesser General Public License as
published by\n# the Free Software Foundation; either version 2.1 of the License, or\n# (at your
option) any later version.\n#\n# Entries in this file show the compile time defaults.\n# You can change
settings by editing this file.\n# Defaults can be restored by simply deleting this file.\n#\n# See
timesyncd.conf(5)
for
details.\n\n[Time]\nNTP=127.0.0.1
213.251.52.43
91.236.251.11
\n#FallbackNTP=0.debian.pool.ntp.org
1.debian.pool.ntp.org
2.debian.pool.ntp.org
3.debian.pool.ntp.org\n"
},
"status": "OK"
}
Time keeping on the U-router NGW is performed by the
systemd-timesyncd
(see chapter:10). This
process attempts to synchronize the system clock with accurate clocks (NTP servers) on the Internet.
When the NTP servers are not reachable, the system clock can also be synchronized to the clock of
the mobile network. The configuration only needs the IP addresses of the available NTP servers in
order to work.
You can use the POST /api/timeserver endpoint to change the timeserver configuration and to
enable/disable the timeserver daemon on the system. The possible POST parameters are:
enable
To enable to timeserver subsystem. Possible options are:
•
ON
•
OFF
config_txt
The complete client configuration for system-timesyncd.
Maximum length of this field is 4096 Bytes.
If you want to switch the timeserver on you can perform the following API call:
As an example, to configure the timeserver and turn it on:
curl -X POST https://192.168.168.1/api/timeserver -u rfi:rfi123 -d
"enable=ON&config_txt=
NTP=127.0.0.1 213.251.52.43 91.236.251.11
"
Returns:
{
"status": "OK"
}