Commit Graph

65 Commits

Author SHA1 Message Date
Christina Wang
27249c2785 Explain /v2/state/status's status field in its response
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>
2022-04-18 13:16:32 -07:00
Christina Wang
5f1a77da25 Add update lock check to PATCH /v1/device/host-config
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>
2022-02-14 22:22:00 +00:00
Vipul Gupta (@vipulgupta2048)
277ab39dab Replace application --> fleet
Signed-off-by: Vipul Gupta (@vipulgupta2048) <vipul@balena.io>
2022-01-20 18:17:30 +05:30
Vipul Gupta (@vipulgupta2048)
a631e86997 patch: Update fleet terminology for the Supervisor API
Signed-off-by: Vipul Gupta (@vipulgupta2048) <vipul@balena.io>
2022-01-20 18:15:25 +05:30
fisehara
0c8c1864ae add-supervisor-update-info
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>
2021-12-28 19:58:51 +01:00
Kyle Harding
2bcc3aeb56
Update URL to balena-proxy-config source code
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>
2021-09-02 08:22:26 -04:00
Miguel Casqueira
3bc3274001 Clarify that /v2/applications/:appId/stop-service is temporary
Change-type: patch
Signed-off-by: Miguel Casqueira <miguel@balena.io>
2021-07-05 19:25:04 -04:00
Christina Wang
5524b5e986
Revert multiline bullet points in notes
Docs engine cannot support > - markdown pattern.

Change-type: patch
Signed-off-by: Christina Wang <christina@balena.io>
2021-05-26 17:13:50 +09:00
Christina Wang
7c4d232439
Specify that all restart API endpoints remove and recreate containers
This is intended behavior.

Also add quotes around UUID in examples to reduce confusion, and format responses
as multiline JSON for clarity.

Closes: #1620
Closes: #1681
Change-type: patch
Signed-off-by: Christina Wang <christina@balena.io>
2021-05-19 11:36:01 +09:00
Vipul Gupta (@vipulgupta2048)
732950fb9e Add message to refer to v2 endpoints
Change-type: patch
Signed-off-by: Vipul Gupta (@vipulgupta2048) <vipul@balena.io>
2021-04-06 14:16:12 +00:00
Matthew McGinn
f9a157c9ec typos: seperate -> separate
mainly to get the docs one, but figured i could hit them all

Change-type: patch
Signed-off-by: Matthew McGinn <matthew@balena.io>
2021-03-17 14:27:53 -04:00
Miguel Casqueira
c64d3cb216 Clarify when update_pending in /v1/device is true
Change-type: patch
Signed-off-by: Miguel Casqueira <miguel@balena.io>
2020-10-30 18:46:22 -04:00
Nitish Agarwal
82dda7d852 Fixes documentation - ping doesn't need apiKey and minor documentation formatting changes.
Change-Type: patch
Signed-off-by: Nitish Agarwal <1592163+nitishagar@users.noreply.github.com>
Co-authored-by: xginn8 <xginn8@users.noreply.github.com>
2020-07-31 23:38:21 +05:30
Rich Bayliss
1b91ef3405
state: Report device MAC address to the API
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>
2020-06-22 10:41:06 +01:00
Miguel Casqueira
8295858b32 Added endpoint to check if VPN is connected
Change-type: minor
Signed-off-by: Miguel Casqueira <miguel@balena.io>
2020-05-11 21:21:44 -04:00
Cameron Diver
3ff3bce605 Allow getting the target state when not in local mode
Change-type: patch
Closes: #1176
Signed-off-by: Cameron Diver <cameron@balena.io>
2020-01-30 11:24:59 +00:00
Cameron Diver
da0534b3c8 Add usage example repo to documentation
Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-08-21 18:33:47 +01:00
Cameron Diver
48bccd34db Add journald format flag
Change-type: minor
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-08-21 15:02:05 +01:00
Cameron Diver
2d924b83fc Update documentation and explicitly unpipe journald stream
Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-08-21 15:02:05 +01:00
Matthew McGinn
8c9f974b07 docs: fix up typo "sucess" -> "success"
Related to https://github.com/balena-io/docs/pull/1065

Change-type: patch
Signed-off-by: Matthew McGinn <matthew@balena.io>
2019-08-09 16:36:57 +02:00
Cameron Diver
1794b334a0
Fix version documentation for journald endpoint
Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-08-09 12:48:06 +01:00
Cameron Diver
43cbf7dbba
Add an endpoint and module for reading journald logs
Change-type: minor
Closes: #1003
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-08-09 11:08:29 +01:00
Matthew McGinn
f2bb8a768e docs: update APPID to BALENA_APP_ID as exposed from the env
Change-type: patch
Signed-off-by: Matthew McGinn <matthew@balena.io>
2019-07-24 23:40:31 +01:00
Cameron Diver
3304825216 Add a supervisor endpoint to cleanup orphaned volumes
Change-type: minor
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-07-10 14:25:44 +01:00
Matthew McGinn
baa0e87513 docs: fix up broken meta-balena proxy link
Change-type: patch
Signed-off-by: Matthew McGinn <matthew@balena.io>
2019-07-10 10:11:46 +02:00
Matthew McGinn
acb38dfcfa docs: make headers consistent
Change-type: patch
Signed-off-by: Matthew McGinn <matthew@balena.io>
2019-05-07 00:41:58 +08:00
Matthew McGinn
331b109a64 docs: fix up some stray resin references
Change-type: patch
Signed-off-by: Matthew McGinn <matthew@balena.io>
2019-05-03 18:58:56 +08:00
Cameron Diver
b922789dee
device-api: Add v2/device/tags api endpoint
This endpoint will fetch the device tags from the balena api

Change-type: minor
Closes: #890
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-03-13 14:21:23 +00:00
Cameron Diver
3f231e8ff3
device-api: Add v2/device/name endpoint
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>
2019-03-13 14:21:22 +00:00
Cameron Diver
d9bc26bd83
docs: Standardise naming and json in api documentation
Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-03-11 16:39:06 +00:00
Cameron Diver
4a17f704ab
docs: Add documentation for v2/state/status endpoint
Change-type: minor
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-03-11 16:24:44 +00:00
Heds Simons
79e7fb0b93
docs: Clarify Supervisor envvars exposure via label
Connects-to: #830
Change-type: patch
Signed-off-by: Heds Simons <heds@whaleway.net>
2018-12-04 16:38:26 +00:00
Pablo Carranza Velez
7fe94ec115 docs: Clarify that older supervisors use RESIN_ variables
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>
2018-11-30 14:45:10 -03:00
Cameron Diver
311eaf0ac0
device-api: Add container id endpoint
Change-type: minor
Signed-off-by: Cameron Diver <cameron@balena.io>
2018-11-28 16:44:19 +00:00
hippolyt
04ec6d1379
Appended API example
Added api proxy example to /supervisor/v2/applications/state

Change-type: patch
2018-11-07 10:22:15 +00:00
Cameron Diver
3ad8700066
doc: Add documentation for supervisor endpoints added after v7
Change-type: patch
Signed-off-by: Cameron Diver <cameron@resin.io>
2018-11-06 13:13:06 +00:00
Pablo Carranza Velez
8298487a88 Rename most of the documentation and variable names from resin to balena
Change-type: minor
Signed-off-by: Pablo Carranza Velez <pablo@balena.io>
2018-11-01 17:00:13 -07:00
Pablo Carranza Velez
87a8d8f8f4 Env var changes in API docs, new private env vars, remove unused vars
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>
2018-10-16 15:12:05 +02:00
Cameron Diver
409a582507
Docs: Add documentation for the v2/applications/state endpoint
Change-type: patch
Closes: #719
Signed-off-by: Cameron Diver <cameron@resin.io>
2018-08-13 10:51:32 +01:00
Tim Perry
2586ab3677 Update docs with multicontainer API breakages
Change-Type: patch
2018-05-11 17:36:12 +02:00
Pablo Carranza Velez
348ff66cee
Replace the gosuper component with a node module that handles communication with systemd, and stop using an init system in the supervisor container
Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2018-03-22 15:55:15 +00:00
Pablo Carranza Velez
5d7d99c258 Document that the update lock can be forced on reboots and shutdowns
Closes #373
Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2018-03-19 16:30:59 -03:00
Pablo Carranza Velez
0e7bb77c41 docs: clarify that open connections will not be closed when configuring a proxy, and change all proxy API examples to use uuid
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2018-01-18 19:07:00 -03:00
Pablo Carranza Velez
0960d947ed Add documentation for the /v1/device/host-config endpoint
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2018-01-18 18:28:05 -03:00
Pablo Carranza Velez
95bbe6ea49 Add a /v1/healthy endpoint that fails if the supervisor is unhealthy, and a HEALTHCHECK command to the Dockerfile that uses it
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>
2017-12-11 00:11:56 -08:00
Pablo Carranza Velez
42ac7487e7 When the device is about to reboot or shutdown, close the API server and avoid applying updates
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>
2017-07-27 20:07:24 -03:00
Horia Delicoti
ff632e811c docs/API.md: Fix documentation command sent via the API proxy for POST /v1/update.
Change-Type: patch
Signed-off-by: Horia Delicoti <horia.delicoti@gmail.com>
2017-04-11 08:09:27 +02:00
Pablo Carranza Vélez
55a8f897e8 Fix docs
Do not document the container management endpoints, as the API can and will probably have changes soon
2016-08-15 23:07:00 +02:00
Pablo Carranza Velez
534035e7ae Changelog and docs for /v1/images/load 2016-05-19 13:27:59 +00:00
Pablo Carranza Velez
55870b16b1 Changelog and docs for image and container endpoints 2016-05-16 09:52:48 -03:00