mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-01-30 16:13:59 +00:00
Add a device shutdown command, and allow forcing reboot and shutdown
This commit is contained in:
parent
0f4eca2ff0
commit
9cf42462c0
@ -73,4 +73,12 @@ limitations under the License.
|
|||||||
alias: 'k'
|
alias: 'k'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
exports.forceUpdateLock = {
|
||||||
|
signature: 'force',
|
||||||
|
parameter: 'force',
|
||||||
|
description: 'force action if the update lock is set',
|
||||||
|
boolean: true,
|
||||||
|
alias: 'f'
|
||||||
|
};
|
||||||
|
|
||||||
}).call(this);
|
}).call(this);
|
||||||
|
@ -141,11 +141,25 @@ limitations under the License.
|
|||||||
signature: 'device reboot <uuid>',
|
signature: 'device reboot <uuid>',
|
||||||
description: 'restart a device',
|
description: 'restart a device',
|
||||||
help: 'Use this command to remotely reboot a device\n\nExamples:\n\n $ resin device reboot 23c73a1',
|
help: 'Use this command to remotely reboot a device\n\nExamples:\n\n $ resin device reboot 23c73a1',
|
||||||
|
options: [commandOptions.forceUpdateLock],
|
||||||
permission: 'user',
|
permission: 'user',
|
||||||
action: function(params, options, done) {
|
action: function(params, options, done) {
|
||||||
var resin;
|
var resin;
|
||||||
resin = require('resin-sdk');
|
resin = require('resin-sdk');
|
||||||
return resin.models.device.reboot(params.uuid).nodeify(done);
|
return resin.models.device.reboot(params.uuid, options).nodeify(done);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.shutdown = {
|
||||||
|
signature: 'device shutdown <uuid>',
|
||||||
|
description: 'shutdown a device',
|
||||||
|
help: 'Use this command to remotely shutdown a device\n\nExamples:\n\n $ resin device shutdown 23c73a1',
|
||||||
|
options: [commandOptions.forceUpdateLock],
|
||||||
|
permission: 'user',
|
||||||
|
action: function(params, options, done) {
|
||||||
|
var resin;
|
||||||
|
resin = require('resin-sdk');
|
||||||
|
return resin.models.device.shutdown(params.uuid, options).nodeify(done);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -38,6 +38,7 @@ Now you have access to all the commands referenced below.
|
|||||||
- [device rm <uuid>](#device-rm-60-uuid-62-)
|
- [device rm <uuid>](#device-rm-60-uuid-62-)
|
||||||
- [device identify <uuid>](#device-identify-60-uuid-62-)
|
- [device identify <uuid>](#device-identify-60-uuid-62-)
|
||||||
- [device reboot <uuid>](#device-reboot-60-uuid-62-)
|
- [device reboot <uuid>](#device-reboot-60-uuid-62-)
|
||||||
|
- [device shutdown <uuid>](#device-shutdown-60-uuid-62-)
|
||||||
- [device public-url enable <uuid>](#device-public-url-enable-60-uuid-62-)
|
- [device public-url enable <uuid>](#device-public-url-enable-60-uuid-62-)
|
||||||
- [device public-url disable <uuid>](#device-public-url-disable-60-uuid-62-)
|
- [device public-url disable <uuid>](#device-public-url-disable-60-uuid-62-)
|
||||||
- [device public-url <uuid>](#device-public-url-60-uuid-62-)
|
- [device public-url <uuid>](#device-public-url-60-uuid-62-)
|
||||||
@ -339,6 +340,26 @@ Examples:
|
|||||||
|
|
||||||
$ resin device reboot 23c73a1
|
$ resin device reboot 23c73a1
|
||||||
|
|
||||||
|
### Options
|
||||||
|
|
||||||
|
#### --force, -f <force>
|
||||||
|
|
||||||
|
force action if the update lock is set
|
||||||
|
|
||||||
|
## device shutdown <uuid>
|
||||||
|
|
||||||
|
Use this command to remotely shutdown a device
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
|
||||||
|
$ resin device shutdown 23c73a1
|
||||||
|
|
||||||
|
### Options
|
||||||
|
|
||||||
|
#### --force, -f <force>
|
||||||
|
|
||||||
|
force action if the update lock is set
|
||||||
|
|
||||||
## device public-url enable <uuid>
|
## device public-url enable <uuid>
|
||||||
|
|
||||||
Use this command to enable public URL for a device
|
Use this command to enable public URL for a device
|
||||||
|
@ -61,3 +61,10 @@ exports.wifiKey =
|
|||||||
parameter: 'key'
|
parameter: 'key'
|
||||||
description: 'wifi key, if network is wifi'
|
description: 'wifi key, if network is wifi'
|
||||||
alias: 'k'
|
alias: 'k'
|
||||||
|
|
||||||
|
exports.forceUpdateLock =
|
||||||
|
signature: 'force'
|
||||||
|
parameter: 'force'
|
||||||
|
description: 'force action if the update lock is set'
|
||||||
|
boolean: true
|
||||||
|
alias: 'f'
|
||||||
|
@ -201,10 +201,27 @@ exports.reboot =
|
|||||||
|
|
||||||
$ resin device reboot 23c73a1
|
$ resin device reboot 23c73a1
|
||||||
'''
|
'''
|
||||||
|
options: [ commandOptions.forceUpdateLock ]
|
||||||
permission: 'user'
|
permission: 'user'
|
||||||
action: (params, options, done) ->
|
action: (params, options, done) ->
|
||||||
resin = require('resin-sdk')
|
resin = require('resin-sdk')
|
||||||
resin.models.device.reboot(params.uuid).nodeify(done)
|
resin.models.device.reboot(params.uuid, options).nodeify(done)
|
||||||
|
|
||||||
|
exports.shutdown =
|
||||||
|
signature: 'device shutdown <uuid>'
|
||||||
|
description: 'shutdown a device'
|
||||||
|
help: '''
|
||||||
|
Use this command to remotely shutdown a device
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
|
||||||
|
$ resin device shutdown 23c73a1
|
||||||
|
'''
|
||||||
|
options: [ commandOptions.forceUpdateLock ]
|
||||||
|
permission: 'user'
|
||||||
|
action: (params, options, done) ->
|
||||||
|
resin = require('resin-sdk')
|
||||||
|
resin.models.device.shutdown(params.uuid, options).nodeify(done)
|
||||||
|
|
||||||
exports.enableDeviceUrl =
|
exports.enableDeviceUrl =
|
||||||
signature: 'device public-url enable <uuid>'
|
signature: 'device public-url enable <uuid>'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user