Add watch target
Adds a container, systemd unit or pm2 app to the watch list. Protection: token. Adding a name that is already listed returns added: false and changes nothing. The route does not check kind against the three values. An unknown value is accepted and echoed back, and every later read of the list treats it as docker.
Authorizations
The token you start the server with: homebutler serve --token <token>, or web.token in the config file. Send it as Authorization: Bearer <token>. When the server has a token, every /api/ route except the CORS preflight requires it, reads included.
Body
application/jsonThe name of the container, systemd unit or pm2 app to watch.
What kind of target it is.
The actual service or app name, when it differs from container.
Response
200 · application/jsonThe target was added, or was already on the list.
The target name.
The kind from the request, or docker.
false when the target was already on the list.