From 409a582507ee1c0360a9333c14d03fabd1b328bd Mon Sep 17 00:00:00 2001 From: Cameron Diver Date: Tue, 7 Aug 2018 13:42:55 +0100 Subject: [PATCH] Docs: Add documentation for the v2/applications/state endpoint Change-type: patch Closes: #719 Signed-off-by: Cameron Diver --- docs/API.md | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/docs/API.md b/docs/API.md index 31c83aad..f713e9df 100644 --- a/docs/API.md +++ b/docs/API.md @@ -567,3 +567,52 @@ $ curl -X POST --header "Content-Type:application/json" \ --data '{"uuid": , "method": "GET"}' \ "https://api.resin.io/supervisor/v1/device/host-config" ``` + +### GET /v2/applications/state + +Added in supervisor v7.12.0 + +Get a list of applications, services and their statuses. This will reflect the +current state of the supervisor, and not the target state. + +From the user container: +```bash +$ curl "$RESIN_SUPERVISOR_ADDRESS/v2/applications/state?apikey=$RESIN_SUPERVISOR_API_KEY" +``` + +Response: +```json +{ + "appname": { + "appId": 1011165, + "commit": "217d55237092995e4576367e529ebb03", + "services": { + "main": { + "status": "Downloaded", + "releaseId": 557617, + "downloadProgress": null + }, + "frontend": { + "status": "Downloading", + "releaseId": 557631, + "downloadProgress": 0 + }, + "proxy": { + "status": "Downloaded", + "releaseId": 557631, + "downloadProgress": null + }, + "data": { + "status": "Downloading", + "releaseId": 557631, + "downloadProgress": 7 + }, + "metrics": { + "status": "Downloading", + "releaseId": 557631, + "downloadProgress": 35 + } + } + } +} +```