Skip to main content

Add watch target

POST/api/watch/targets

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

Authorizationstringheaderrequired

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/json
containerstringrequired

The name of the container, systemd unit or pm2 app to watch.

Example: flaky
kindstring

What kind of target it is.

Default: "docker"Available options: dockersystemdpm2
unitstring

The actual service or app name, when it differs from container.

Response

200 · application/json

The target was added, or was already on the list.

containerstringrequired

The target name.

kindstringrequired

The kind from the request, or docker.

addedbooleanrequired

false when the target was already on the list.