mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-24 07:46:39 +00:00
Update device.overall_status comments with their respective replacements
Changelog-entry: Rename `device.overall_status` values: `IDLE` to `OPERATIONAL`, `OFFLINE` to `DISCONNECTED`; add `REDUCED_FUNCTIONALITY` Change-type: major
This commit is contained in:
parent
56e5dafb20
commit
1ee9a68288
@ -156,7 +156,7 @@ export default class DeviceRestartCmd extends Command {
|
|||||||
|
|
||||||
async restartAllServices(balena: BalenaSDK, deviceUuid: string) {
|
async restartAllServices(balena: BalenaSDK, deviceUuid: string) {
|
||||||
// Note: device.restartApplication throws `BalenaDeviceNotFound: Device not found` if device not online.
|
// Note: device.restartApplication throws `BalenaDeviceNotFound: Device not found` if device not online.
|
||||||
// Need to use device.get first to distinguish between non-existant and offline devices.
|
// Need to use device.get first to distinguish between non-existant and disconnected devices.
|
||||||
// Remove this workaround when SDK issue resolved: https://github.com/balena-io/balena-sdk/issues/649
|
// Remove this workaround when SDK issue resolved: https://github.com/balena-io/balena-sdk/issues/649
|
||||||
const { instanceOf, ExpectedError } = await import('../../errors');
|
const { instanceOf, ExpectedError } = await import('../../errors');
|
||||||
try {
|
try {
|
||||||
|
@ -319,7 +319,7 @@ export async function awaitDeviceOsUpdate(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (osUpdateProgress !== null) {
|
if (osUpdateProgress !== null) {
|
||||||
// Avoid resetting to 0% at end of process when device goes offline.
|
// Avoid resetting to 0% at end of process when device goes disconnected.
|
||||||
progressBar.update({ percentage: osUpdateProgress });
|
progressBar.update({ percentage: osUpdateProgress });
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -358,7 +358,9 @@ export async function getOnlineTargetDeviceUuid(
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (!device.is_online) {
|
if (!device.is_online) {
|
||||||
throw new ExpectedError(`Device with UUID ${fleetOrDevice} is offline`);
|
throw new ExpectedError(
|
||||||
|
`Device with UUID ${fleetOrDevice} is disconnected`,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return device.uuid;
|
return device.uuid;
|
||||||
|
@ -121,7 +121,7 @@ describe('balena device ssh', function () {
|
|||||||
|
|
||||||
itSS('should fail if device not online (mocked, device UUID)', async () => {
|
itSS('should fail if device not online (mocked, device UUID)', async () => {
|
||||||
const deviceUUID = 'abc1234';
|
const deviceUUID = 'abc1234';
|
||||||
const expectedErrLines = ['Device with UUID abc1234 is offline'];
|
const expectedErrLines = ['Device with UUID abc1234 is disconnected'];
|
||||||
api.expectGetWhoAmI({ optional: true, persist: true });
|
api.expectGetWhoAmI({ optional: true, persist: true });
|
||||||
api.expectGetDevice({ fullUUID: deviceUUID, isOnline: false });
|
api.expectGetDevice({ fullUUID: deviceUUID, isOnline: false });
|
||||||
mockedExitCode = 0;
|
mockedExitCode = 0;
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
"os_version": "balenaOS 2.44.0+rev3",
|
"os_version": "balenaOS 2.44.0+rev3",
|
||||||
"supervisor_version": "10.3.7",
|
"supervisor_version": "10.3.7",
|
||||||
"is_web_accessible": false,
|
"is_web_accessible": false,
|
||||||
"overall_status": "idle",
|
"overall_status": "reduced-functionality",
|
||||||
"cpu_usage": 34,
|
"cpu_usage": 34,
|
||||||
"cpu_temp": 56.2,
|
"cpu_temp": 56.2,
|
||||||
"cpu_id": "some cpu id",
|
"cpu_id": "some cpu id",
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
"os_version": "balenaOS 2.44.0+rev3",
|
"os_version": "balenaOS 2.44.0+rev3",
|
||||||
"supervisor_version": "10.3.7",
|
"supervisor_version": "10.3.7",
|
||||||
"is_web_accessible": false,
|
"is_web_accessible": false,
|
||||||
"overall_status": "offline",
|
"overall_status": "disconnected",
|
||||||
"__metadata": {
|
"__metadata": {
|
||||||
"uri": "/resin/device(@id)?@id=1747415"
|
"uri": "/resin/device(@id)?@id=1747415"
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"d": [
|
"d": [
|
||||||
{
|
{
|
||||||
"overall_status": "offline",
|
"overall_status": "disconnected",
|
||||||
"__metadata": {}
|
"__metadata": {}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -4073,7 +4073,7 @@
|
|||||||
"state": "DISCONTINUED",
|
"state": "DISCONTINUED",
|
||||||
"stateInstructions": {
|
"stateInstructions": {
|
||||||
"postProvisioning": [
|
"postProvisioning": [
|
||||||
"The device is performing a shutdown. Please wait until the device is offline in the dashboard and disconnect the power cable.",
|
"The device is performing a shutdown. Please wait until the device is disconnected in the dashboard and disconnect the power cable.",
|
||||||
"Remove the resinOS installation media.",
|
"Remove the resinOS installation media.",
|
||||||
"Set J11 (just next to the micro SD card slot) to position 1-2 (the position closest to the edge of the board).",
|
"Set J11 (just next to the micro SD card slot) to position 1-2 (the position closest to the edge of the board).",
|
||||||
"Remove and re-connect power to the board."
|
"Remove and re-connect power to the board."
|
||||||
@ -4084,7 +4084,7 @@
|
|||||||
"Insert the freshly burnt SD card into the VIA VAB 820-quad.",
|
"Insert the freshly burnt SD card into the VIA VAB 820-quad.",
|
||||||
"<strong role=\"alert\">Warning!</strong> This will also completely erase internal storage media, so please make a backup first.",
|
"<strong role=\"alert\">Warning!</strong> This will also completely erase internal storage media, so please make a backup first.",
|
||||||
"Set J11 (just next to the micro SD card slot) to position 2-3 (the position furthest away from the edge of the board) and then power on the board.",
|
"Set J11 (just next to the micro SD card slot) to position 2-3 (the position furthest away from the edge of the board) and then power on the board.",
|
||||||
"The device is performing a shutdown. Please wait until the device is offline in the dashboard and disconnect the power cable.",
|
"The device is performing a shutdown. Please wait until the device is disconnected in the dashboard and disconnect the power cable.",
|
||||||
"Remove the resinOS installation media.",
|
"Remove the resinOS installation media.",
|
||||||
"Set J11 (just next to the micro SD card slot) to position 1-2 (the position closest to the edge of the board).",
|
"Set J11 (just next to the micro SD card slot) to position 1-2 (the position closest to the edge of the board).",
|
||||||
"Remove and re-connect power to the board."
|
"Remove and re-connect power to the board."
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
"os_version": "balenaOS 2.44.0+rev3",
|
"os_version": "balenaOS 2.44.0+rev3",
|
||||||
"supervisor_version": "10.3.7",
|
"supervisor_version": "10.3.7",
|
||||||
"is_web_accessible": false,
|
"is_web_accessible": false,
|
||||||
"overall_status": "offline",
|
"overall_status": "disconnected",
|
||||||
"cpu_usage": 34,
|
"cpu_usage": 34,
|
||||||
"cpu_temp": 56.2,
|
"cpu_temp": 56.2,
|
||||||
"cpu_id": "some cpu id",
|
"cpu_id": "some cpu id",
|
||||||
|
Loading…
Reference in New Issue
Block a user