Merge pull request #322 from resin-io/feat/device-reboot

Implement device reboot command
This commit is contained in:
Juan Cruz Viotti 2016-03-07 08:33:14 -04:00
commit 091ae8eb03
6 changed files with 40 additions and 1 deletions

View File

@ -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',

View File

@ -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);

View File

@ -36,6 +36,7 @@ Now you have access to all the commands referenced below.
- [device register &#60;application&#62;](#device-register-60-application-62-)
- [device rm &#60;uuid&#62;](#device-rm-60-uuid-62-)
- [device identify &#60;uuid&#62;](#device-identify-60-uuid-62-)
- [device reboot &#60;uuid&#62;](#device-reboot-60-uuid-62-)
- [device rename &#60;uuid&#62; [newName]](#device-rename-60-uuid-62-newname-)
- [device move &#60;uuid&#62;](#device-move-60-uuid-62-)
- [device init](#device-init)
@ -308,6 +309,14 @@ Examples:
$ resin device identify 23c73a1
## device reboot &#60;uuid&#62;
Use this command to remotely reboot a device
Examples:
$ resin device reboot 23c73a1
## device rename &#60;uuid&#62; [newName]
Use this command to rename a device.

View File

@ -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'

View File

@ -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)

View File

@ -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",