mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-04-07 11:26:41 +00:00
Implement device reboot command
Fixes: https://github.com/resin-io/resin-cli/issues/319
This commit is contained in:
parent
797122ce37
commit
6405c6bb6f
@ -123,6 +123,18 @@ limitations under the License.
|
||||
}
|
||||
};
|
||||
|
||||
exports.reboot = {
|
||||
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',
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
var resin;
|
||||
resin = require('resin-sdk');
|
||||
return resin.models.device.reboot(params.uuid).nodeify(done);
|
||||
}
|
||||
};
|
||||
|
||||
exports.rename = {
|
||||
signature: 'device rename <uuid> [newName]',
|
||||
description: 'rename a resin device',
|
||||
|
@ -87,6 +87,8 @@ limitations under the License.
|
||||
|
||||
capitano.command(actions.device.identify);
|
||||
|
||||
capitano.command(actions.device.reboot);
|
||||
|
||||
capitano.command(actions.device.register);
|
||||
|
||||
capitano.command(actions.device.move);
|
||||
|
@ -36,6 +36,7 @@ Now you have access to all the commands referenced below.
|
||||
- [device register <application>](#device-register-60-application-62-)
|
||||
- [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 rename <uuid> [newName]](#device-rename-60-uuid-62-newname-)
|
||||
- [device move <uuid>](#device-move-60-uuid-62-)
|
||||
- [device init](#device-init)
|
||||
@ -308,6 +309,14 @@ Examples:
|
||||
|
||||
$ resin device identify 23c73a1
|
||||
|
||||
## device reboot <uuid>
|
||||
|
||||
Use this command to remotely reboot a device
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin device reboot 23c73a1
|
||||
|
||||
## device rename <uuid> [newName]
|
||||
|
||||
Use this command to rename a device.
|
||||
|
@ -171,6 +171,21 @@ exports.identify =
|
||||
resin = require('resin-sdk')
|
||||
resin.models.device.identify(params.uuid).nodeify(done)
|
||||
|
||||
exports.reboot =
|
||||
signature: 'device reboot <uuid>'
|
||||
description: 'restart a device'
|
||||
help: '''
|
||||
Use this command to remotely reboot a device
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin device reboot 23c73a1
|
||||
'''
|
||||
permission: 'user'
|
||||
action: (params, options, done) ->
|
||||
resin = require('resin-sdk')
|
||||
resin.models.device.reboot(params.uuid).nodeify(done)
|
||||
|
||||
exports.rename =
|
||||
signature: 'device rename <uuid> [newName]'
|
||||
description: 'rename a resin device'
|
||||
|
@ -69,6 +69,7 @@ capitano.command(actions.device.rename)
|
||||
capitano.command(actions.device.init)
|
||||
capitano.command(actions.device.remove)
|
||||
capitano.command(actions.device.identify)
|
||||
capitano.command(actions.device.reboot)
|
||||
capitano.command(actions.device.register)
|
||||
capitano.command(actions.device.move)
|
||||
capitano.command(actions.device.info)
|
||||
|
@ -52,7 +52,7 @@
|
||||
"resin-device-init": "^2.0.0",
|
||||
"resin-image-manager": "^4.0.0",
|
||||
"resin-pine": "^1.3.0",
|
||||
"resin-sdk": "^5.1.0",
|
||||
"resin-sdk": "^5.2.0",
|
||||
"resin-settings-client": "^3.1.0",
|
||||
"resin-vcs": "^2.0.0",
|
||||
"rimraf": "^2.4.3",
|
||||
|
Loading…
x
Reference in New Issue
Block a user