Server-API: time sync
Als Markdown kopierenDiese Routen liegen auf der Server-API, Port 21114 (21121 in Docker). Sie nehmen einen API-Schlüssel in X-API-Key oder ein Anmelde-Token; siehe Die HTTP-API. Die Beschreibungen stehen auf Englisch, wie in der OpenAPI-Beschreibung.
The server's clock check against NTP, which billing relies on.
Check the server clock now.
Asks the NTP servers now and answers the result.
On the server API, port 21114. Needs server.config.
200: The check (application/json)
| Error | When |
|---|---|
| 401 | No credential, or one that is not valid |
| 403 | The credential's role lacks the permission |
| 503 | The clock check is not set up |
Show the clock check settings.
On the server API, port 21114. Needs server.config.
200: The settings (application/json)
| Error | When |
|---|---|
| 401 | No credential, or one that is not valid |
| 403 | The credential's role lacks the permission |
| 503 | The clock check is not set up |
Change the clock check settings.
Saves the settings in the database, applies them without a restart and checks the clock at once. The change is written in the audit log.
On the server API, port 21114. Needs server.config.
Request body, application/json:
All settings: require_synced_clock and trust_os_ntp are false when missing.
| Field | Type | Required | What it is |
|---|---|---|---|
ntp_servers |
string | yes | NTP servers, separated by commas: host names or IP addresses |
max_skew_ms |
integer | yes | The largest offset that counts as synced, in milliseconds; at least 1, at most 600000 |
require_synced_clock |
boolean | Whether billing needs a synced clock | |
trust_os_ntp |
boolean | Whether the operating system's NTP sync counts | |
server_timezone |
string | The server's time zone (SERVER_TIMEZONE), an IANA name; missing or empty is UTC |
200: Saved, with the new check (application/json)
| Field | Type |
|---|---|
config |
TimeSyncConfig |
status |
TimeSyncStatus |
| Error | When |
|---|---|
| 400 | The body is not valid JSON, or a server name, max_skew_ms or server_timezone is not valid |
| 401 | No credential, or one that is not valid |
| 403 | The credential's role lacks the permission |
| 503 | The clock check is not set up |
Show whether the server clock is synced.
On the server API, port 21114. Needs billing.view.
200: The last check (application/json)
| Error | When |
|---|---|
| 401 | No credential, or one that is not valid |
| 403 | The credential's role lacks the permission |
| 503 | The clock check is not set up |