Clarify that only containers on a single device will be restarted following API key refresh,
not the whole fleet. Each device has its own distinct API key.
Change-type: patch
Signed-off-by: Christina Ying Wang <christina@balena.io>
The status field does not indicate the current state of the Engine on the device.
Rather, it only indicates whether the HTTP response returned successfully or not.
To get the current state of the device, i.e. whether it has applied target state or not,
use the `appState` field in the response.
Change-type: patch
Signed-off-by: Christina Wang <christina@balena.io>
This is necessary with the changes as of balenaOS 2.82.6, which watches config.json
and will restart balena-hostname and some other services automatically on file change.
Change-type: patch
Relates-to: #1876
Signed-off-by: Christina Wang <christina@balena.io>
Adding clarity to the supervisor /v1/update endpoint that the endpoint will not trigger a supervisor update itself.
Change-type: patch
Signed-off-by: fisehara <harald@balena.io>
Use a GitHub permalink that includes the commit in
case the file changes and the reference becomes out-of-date.
Change-type: patch
Signed-off-by: Kyle Harding <kyle@balena.io>
This is intended behavior.
Also add quotes around UUID in examples to reduce confusion, and format responses
as multiline JSON for clarity.
Closes: #1620Closes: #1681
Change-type: patch
Signed-off-by: Christina Wang <christina@balena.io>
When reporting device information, send the MAC address of any
interfaces on the system. Also expose in the Supervisor API at
the route GET /v1/device.
Change-type: patch
Signed-off-by: Rich Bayliss <rich@balena.io>
This endpoint returns the last known device name from the API. This
differs from the BALENA_DEVICE_NAME_AT_INIT env var because this will
not change throughout the runtime of the container.
Closes: #908
Change-type: minor
Signed-off-by: Cameron Diver <cameron@balena.io>
We add a note on state endpoint docs to use RESIN_ variables. Since users will likely navigate directly to each endpoint, we add the note on the docs for each endpoint, except for endpoints added in >= 7.21.0 (since that version never made it to production).
We also switch some variables that were still referenced as RESIN_ to now use BALENA_.
Change-type: patch
Signed-off-by: Pablo Carranza Velez <pablo@balena.io>
We update the supervisor API docs to reflect the new `BALENA_` injected env vars.
We also add the new sensitive env vars to the list of vars not sent by the API.
And we remove the unused RESIN_DATA_PATH and RESIN_PROXYVISOR_HOOK_RECEIVER from the
vars the supervisor parses from its own environment.
Signed-off-by: Pablo Carranza Velez <pablo@balena.io>
We add an endpoint to the supervisor API that checks the following conditions to determine whether the supervisor is healthy:
* That the update cycle has run fully, in a time that's less than twice the poll interval. Unless we're downloading an image, in which case
we assume it's healthy (otherwise we'd get into the issue of determining a reasonable timeout for the image download, which is already done in a configurable way with delta options and the like).
* That the current state report to the Resin API hasn't failed more than 3 times. Unless the device has no connectivity, or the connectivity check is disabled, in which case we don't know
if the report failed simply because there's no network.
* That the gosuper component is working (since we periodically hit its API to get the IP addresses, we mark it as not working if this API call fails).
We need this endpoint to be unauthenticated for the docker daemon to be able to hit it (though, as the rest of the API, it is protected with iptables rules).
Change-Type: minor
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
We mark when the device is rebooting and avoid some steps in the update cycle that change the device
state, similarly to when the device is in local mode, to avoid problems with non-atomic operations.
This doesn't solve *all* the potential scenarios of a reboot happening in the middle of an update, but at least
should prevent the case where we start an app container and reboot the device before saving the containerId, potentially
causing a duplicated container issue.
We also correct the API docs to reflect the 202 response when reboot or shutdown are successful.
Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>