Last active
March 15, 2016 17:08
-
-
Save craigmulligan/610f023d0e4647cd3586 to your computer and use it in GitHub Desktop.
basic example of node reboot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var resin = require("resin-sdk") | |
var credentials = { email:unicorn@resin.io, password:******* }; | |
var uuid = "7cf02a6" | |
resin.auth.login(credentials, function(error) { | |
if (error != null) { | |
throw error; | |
} | |
console.log("success authenticated with resin API") | |
reboot(); | |
}); | |
function reboot() { | |
resin.models.device.reboot(uuid, function(error) { | |
if (error) throw error; | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment