mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-19 05:37:51 +00:00
Merge pull request #404 from resin-io/reboot-shutdown-force
Add a device shutdown command, and allow forcing reboot and shutdown
This commit is contained in:
commit
0bf6bcc430
@ -73,4 +73,12 @@ limitations under the License.
|
||||
alias: 'k'
|
||||
};
|
||||
|
||||
exports.forceUpdateLock = {
|
||||
signature: 'force',
|
||||
parameter: 'force',
|
||||
description: 'force action if the update lock is set',
|
||||
boolean: true,
|
||||
alias: 'f'
|
||||
};
|
||||
|
||||
}).call(this);
|
||||
|
@ -141,11 +141,25 @@ limitations under the License.
|
||||
signature: 'device reboot <uuid>',
|
||||
description: 'restart a device',
|
||||
help: 'Use this command to remotely reboot a device\n\nExamples:\n\n $ resin device reboot 23c73a1',
|
||||
options: [commandOptions.forceUpdateLock],
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
var resin;
|
||||
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 identify <uuid>](#device-identify-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 disable <uuid>](#device-public-url-disable-60-uuid-62-)
|
||||
- [device public-url <uuid>](#device-public-url-60-uuid-62-)
|
||||
@ -339,6 +340,26 @@ Examples:
|
||||
|
||||
$ 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>
|
||||
|
||||
Use this command to enable public URL for a device
|
||||
|
@ -61,3 +61,10 @@ exports.wifiKey =
|
||||
parameter: 'key'
|
||||
description: 'wifi key, if network is wifi'
|
||||
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
|
||||
'''
|
||||
options: [ commandOptions.forceUpdateLock ]
|
||||
permission: 'user'
|
||||
action: (params, options, done) ->
|
||||
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 =
|
||||
signature: 'device public-url enable <uuid>'
|
||||
|
@ -53,7 +53,7 @@
|
||||
"resin-image-fs": "^2.1.2",
|
||||
"resin-image-manager": "^4.0.0",
|
||||
"resin-pine": "^1.3.0",
|
||||
"resin-sdk": "^5.3.5",
|
||||
"resin-sdk": "^5.4.0",
|
||||
"resin-settings-client": "^3.5.0",
|
||||
"resin-sync": "^3.0.0",
|
||||
"resin-vcs": "^2.0.0",
|
||||
|
Loading…
Reference in New Issue
Block a user