balena-supervisor/test/data/device-api-responses.json

172 lines
4.2 KiB
JSON
Raw Normal View History

{
"V1": {
"GET": {
"/healthy": {
"statusCode": 200,
"body": {},
"text": "OK"
},
"/healthy [2]": {
"statusCode": 500,
"body": {},
"text": "Unhealthy"
},
"/apps/2": {
"statusCode": 200,
"body": {
"appId": 2,
"containerId": "abc123",
"commit": "4e380136c2cf56cd64197d51a1ab263a",
"env": {},
"releaseId": 77777
}
},
"/apps/2 [Multiple containers running]": {
"statusCode": 400,
"body": {
"appId": 2,
"containerId": "abc123",
"commit": "4e380136c2cf56cd64197d51a1ab263a",
"env": {},
"releaseId": 77777
}
},
"/apps/2/stop": {
"statusCode": 200,
"body": {
"containerId": "abc123"
}
},
"/apps/2/stop [Multiple containers running]": {
"statusCode": 400,
"body": {
"containerId": "abc123"
}
}
},
"POST": {
"/restart": {
"statusCode": 200,
"body": {},
"text": "OK"
},
"/restart [Invalid Body]": {
"statusCode": 400,
"body": {},
"text": "Missing app id"
},
"/update [204 Response]": {
"statusCode": 204,
"body": {},
"text": "OK"
},
"/update [202 Response]": {
"statusCode": 202,
"body": {},
"text": "OK"
},
"/blink": {
"statusCode": 200,
"body": {},
"text": "OK"
},
"/regenerate-api-key": {
"statusCode": 200,
"body": {}
}
}
},
"V2": {
"GET": {
"/device/vpn": {
"statusCode": 200,
"body": {
"status": "success",
"vpn": {
"enabled": true,
"connected": false
}
}
},
"/applications/1/state": {
"statusCode": 200,
"body": {
"local": {
"1": {
"services": {
"1111": {
"status": "Running",
"releaseId": 99999,
"download_progress": null
},
"2222": {
"status": "Running",
"releaseId": 99999,
"download_progress": null
}
}
}
},
"dependent": {},
"commit": "7fc9c5bea8e361acd49886fe6cc1e1cd"
}
},
"/applications/9000/state": {
"statusCode": 409,
"body": {
"status": "failed",
"message": "Application ID does not exist: 9000"
}
},
"/applications/123invalid/state": {
"statusCode": 400,
"body": {
"status": "failed",
"message": "Invalid application ID: 123invalid"
}
},
"/state/status?desc=single_application": {
"statusCode": 200,
"body": {
"status": "success",
"appState": "applied",
"overallDownloadProgress": null,
"containers": [
{
"appId": 1658654,
"status": "Running",
"serviceName": "main",
"imageId": 2885946,
"serviceId": 640681,
"containerId": "f93d386599d1b36e71272d46ad69770cff333842db04e2e4c64dda7b54da07c6",
"createdAt": "2020-11-13T20:29:44.143Z"
}
],
"images": [
{
"name": "registry2.balena-cloud.com/v2/e2bf6410ffc30850e96f5071cdd1dca8@sha256:e2e87a8139b8fc14510095b210ad652d7d5badcc64fdc686cbf749d399fba15e",
"appId": 1658654,
"serviceName": "main",
"imageId": 2885946,
"dockerImageId": "sha256:4502983d72e2c72bc292effad1b15b49576da3801356f47fd275ba274d409c1a",
"status": "Downloaded",
"downloadProgress": null
}
]
}
},
"/state/status?desc=no_applications": {
"statusCode": 200,
"body": {
"status": "success",
"appState": "applied",
"overallDownloadProgress": null,
"containers": [],
"images": []
}
}
},
"POST": {}
}
}