Suggestions for API features?

As part of some work I have been doing to improve the workflows for managing monitors the system now has facilities for authentication with APi keys.

Someone recently suggested it’d be nice to have an api for changing “net speeds” on a server. Does anyone have use cases for other APIs (or command line client workflows)?

There are already (unauthenticated) APIs for fetching monitoring data.

Potentially useful could be an API to feed the monitoring system back with hourly/daily average and maximum packet rates observed on the server. The system could estimate the total zone traffic and adjust the weights dynamically for people who don’t want to go over some limit. It could also predict collapsing zones and decide when it should be dissolved in a bigger/continental zone.

1 Like

Exactly. We already discussed this a bit in the following topic:

1 Like

This could then be implemented by pool server operators using scripting that pulls the traffic levels using chronyc, ntpq, or some firewall stats and submits them to what I would guess is a TCP API endpoint.

However, if the endpoint supported UDP feedback, it would be easier to implement the reporting directly in the NTP daemon. To avoid spoofing, you could have the NTP daemon’s first UDP packet to the endpoint be a nonce request. The daemon could then regurgitate the nonce with the traffic feedback in a second packet, giving you three-way-handshake-like assurance the claimed source is able to receive traffic as well.

The nonce value should depend on the source address and port of the request as well as the time of the request, so that the nonce can expire shortly afterward, as well as some secret difficult to predict by the API client. Keeping the issued nonces and accepting each only once could optionally be done at the cost of extra state in the API endpoint provider.

A nice API feature would be to handle the addition of new servers to an account and the verification of the servers. That way, the setup of new servers could be fully scripted.

1 Like