{"action":"created","comment":{"url":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/pulls/comments/82876906","pull_request_review_id":3753584,"id":82876906,"diff_hunk":"@@ -0,0 +1,55 @@\n+'use strict';\n+\n+var Registry = require('azure-iothub').Registry;\n+var Client = require('azure-iothub').Client;\n+\n+var connectionString = '<IoT Hub Connection String>';\n+var registry = Registry.fromConnectionString(connectionString);\n+var client = Client.fromConnectionString(connectionString);\n+var deviceToReboot = 'myDeviceId';\n+\n+var queryTwinLastReboot = function() {\n+  \n+  // Get the twin that has the updated lastReboot time\n+  registry.getTwin(deviceToReboot, function(err, twin){\n+\n+    if (twin.properties.reported.iothubDM != null)\n+    {\n+      if (err) {\n+        console.error('Could not query twins: ' + err.constructor.name + ': ' + err.message);\n+      } else {\n+        \n+        // The device uses the DM pattern to report the status\n+        // of the reboot.  This simplifies reporting against many devices.\n+        var lastRebootTime = twin.properties.reported.iothubDM.reboot.lastReboot;\n+        console.log('Last reboot time: ' + JSON.stringify(lastRebootTime, null, 2));","path":"node/service/samples/dmpatterns_getstarted_service.js","position":25,"original_position":25,"commit_id":"feff7292d2130fd11deb447b31222bdb6c4696d6","original_commit_id":"feff7292d2130fd11deb447b31222bdb6c4696d6","user":{"login":"juanjperez","id":366675,"avatar_url":"https://avatars.githubusercontent.com/u/366675?v=3","gravatar_id":"","url":"https://api.github.com/users/juanjperez","html_url":"https://github.com/juanjperez","followers_url":"https://api.github.com/users/juanjperez/followers","following_url":"https://api.github.com/users/juanjperez/following{/other_user}","gists_url":"https://api.github.com/users/juanjperez/gists{/gist_id}","starred_url":"https://api.github.com/users/juanjperez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juanjperez/subscriptions","organizations_url":"https://api.github.com/users/juanjperez/orgs","repos_url":"https://api.github.com/users/juanjperez/repos","events_url":"https://api.github.com/users/juanjperez/events{/privacy}","received_events_url":"https://api.github.com/users/juanjperez/received_events","type":"User","site_admin":false},"body":"Yes.  Otherwise i get [object object]","created_at":"2016-10-11T20:04:23Z","updated_at":"2016-10-11T20:04:23Z","html_url":"https://github.com/Azure/azure-iot-sdks-preview/pull/2#discussion_r82876906","pull_request_url":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/pulls/comments/82876906"},"html":{"href":"https://github.com/Azure/azure-iot-sdks-preview/pull/2#discussion_r82876906"},"pull_request":{"href":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/pulls/2","id":87064899,"html_url":"https://github.com/Azure/azure-iot-sdks-preview/pull/2","diff_url":"https://github.com/Azure/azure-iot-sdks-preview/pull/2.diff","patch_url":"https://github.com/Azure/azure-iot-sdks-preview/pull/2.patch","issue_url":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/issues/2","number":2,"state":"closed","locked":false,"title":"Initial commit for DM patterns samples","user":{"login":"juanjperez","id":366675,"avatar_url":"https://avatars.githubusercontent.com/u/366675?v=3","gravatar_id":"","url":"https://api.github.com/users/juanjperez","html_url":"https://github.com/juanjperez","followers_url":"https://api.github.com/users/juanjperez/followers","following_url":"https://api.github.com/users/juanjperez/following{/other_user}","gists_url":"https://api.github.com/users/juanjperez/gists{/gist_id}","starred_url":"https://api.github.com/users/juanjperez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juanjperez/subscriptions","organizations_url":"https://api.github.com/users/juanjperez/orgs","repos_url":"https://api.github.com/users/juanjperez/repos","events_url":"https://api.github.com/users/juanjperez/events{/privacy}","received_events_url":"https://api.github.com/users/juanjperez/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-09-28T07:04:57Z","updated_at":"2016-10-11T20:04:23Z","closed_at":"2016-10-10T22:01:04Z","merged_at":null,"merge_commit_sha":"4ff99e187f0f50ef91f05c942d7a285723b94485","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/pulls/2/commits","review_comments_url":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/pulls/2/comments","review_comment_url":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/issues/2/comments","statuses_url":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/statuses/feff7292d2130fd11deb447b31222bdb6c4696d6","head":{"label":"juanjperez:develop","ref":"develop","sha":"feff7292d2130fd11deb447b31222bdb6c4696d6","user":{"login":"juanjperez","id":366675,"avatar_url":"https://avatars.githubusercontent.com/u/366675?v=3","gravatar_id":"","url":"https://api.github.com/users/juanjperez","html_url":"https://github.com/juanjperez","followers_url":"https://api.github.com/users/juanjperez/followers","following_url":"https://api.github.com/users/juanjperez/following{/other_user}","gists_url":"https://api.github.com/users/juanjperez/gists{/gist_id}","starred_url":"https://api.github.com/users/juanjperez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juanjperez/subscriptions","organizations_url":"https://api.github.com/users/juanjperez/orgs","repos_url":"https://api.github.com/users/juanjperez/repos","events_url":"https://api.github.com/users/juanjperez/events{/privacy}","received_events_url":"https://api.github.com/users/juanjperez/received_events","type":"User","site_admin":false},"repo":{"id":69434413,"name":"azure-iot-dt-sdks","full_name":"juanjperez/azure-iot-dt-sdks","owner":{"login":"juanjperez","id":366675,"avatar_url":"https://avatars.githubusercontent.com/u/366675?v=3","gravatar_id":"","url":"https://api.github.com/users/juanjperez","html_url":"https://github.com/juanjperez","followers_url":"https://api.github.com/users/juanjperez/followers","following_url":"https://api.github.com/users/juanjperez/following{/other_user}","gists_url":"https://api.github.com/users/juanjperez/gists{/gist_id}","starred_url":"https://api.github.com/users/juanjperez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juanjperez/subscriptions","organizations_url":"https://api.github.com/users/juanjperez/orgs","repos_url":"https://api.github.com/users/juanjperez/repos","events_url":"https://api.github.com/users/juanjperez/events{/privacy}","received_events_url":"https://api.github.com/users/juanjperez/received_events","type":"User","site_admin":false},"private":true,"html_url":"https://github.com/juanjperez/azure-iot-dt-sdks","description":"IoT SDKs for Device Twin","fork":false,"url":"https://api.github.com/repos/juanjperez/azure-iot-dt-sdks","forks_url":"https://api.github.com/repos/juanjperez/azure-iot-dt-sdks/forks","keys_url":"https://api.github.com/repos/juanjperez/azure-iot-dt-sdks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/juanjperez/azure-iot-dt-sdks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/juanjperez/azure-iot-dt-sdks/teams","hooks_url":"https://api.github.com/repos/juanjperez/azure-iot-dt-sdks/hooks","issue_events_url":"https://api.github.com/repos/juanjperez/azure-iot-dt-sdks/issues/events{/number}","events_url":"https://api.github.com/repos/juanjperez/azure-iot-dt-sdks/events","assignees_url":"https://api.github.com/repos/juanjperez/azure-iot-dt-sdks/assignees{/user}","branches_url":"https://api.github.com/repos/juanjperez/azure-iot-dt-sdks/branches{/branch}","tags_url":"https://api.github.com/repos/juanjperez/azure-iot-dt-sdks/tags","blobs_url":"https://api.github.com/repos/juanjperez/azure-iot-dt-sdks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/juanjperez/azure-iot-dt-sdks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/juanjperez/azure-iot-dt-sdks/git/refs{/sha}","trees_url":"https://api.github.com/repos/juanjperez/azure-iot-dt-sdks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/juanjperez/azure-iot-dt-sdks/statuses/{sha}","languages_url":"https://api.github.com/repos/juanjperez/azure-iot-dt-sdks/languages","stargazers_url":"https://api.github.com/repos/juanjperez/azure-iot-dt-sdks/stargazers","contributors_url":"https://api.github.com/repos/juanjperez/azure-iot-dt-sdks/contributors","subscribers_url":"https://api.github.com/repos/juanjperez/azure-iot-dt-sdks/subscribers","subscription_url":"https://api.github.com/repos/juanjperez/azure-iot-dt-sdks/subscription","commits_url":"https://api.github.com/repos/juanjperez/azure-iot-dt-sdks/commits{/sha}","git_commits_url":"https://api.github.com/repos/juanjperez/azure-iot-dt-sdks/git/commits{/sha}","comments_url":"https://api.github.com/repos/juanjperez/azure-iot-dt-sdks/comments{/number}","issue_comment_url":"https://api.github.com/repos/juanjperez/azure-iot-dt-sdks/issues/comments{/number}","contents_url":"https://api.github.com/repos/juanjperez/azure-iot-dt-sdks/contents/{+path}","compare_url":"https://api.github.com/repos/juanjperez/azure-iot-dt-sdks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/juanjperez/azure-iot-dt-sdks/merges","archive_url":"https://api.github.com/repos/juanjperez/azure-iot-dt-sdks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/juanjperez/azure-iot-dt-sdks/downloads","issues_url":"https://api.github.com/repos/juanjperez/azure-iot-dt-sdks/issues{/number}","pulls_url":"https://api.github.com/repos/juanjperez/azure-iot-dt-sdks/pulls{/number}","milestones_url":"https://api.github.com/repos/juanjperez/azure-iot-dt-sdks/milestones{/number}","notifications_url":"https://api.github.com/repos/juanjperez/azure-iot-dt-sdks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/juanjperez/azure-iot-dt-sdks/labels{/name}","releases_url":"https://api.github.com/repos/juanjperez/azure-iot-dt-sdks/releases{/id}","deployments_url":"https://api.github.com/repos/juanjperez/azure-iot-dt-sdks/deployments","created_at":"2016-09-28T06:48:56Z","updated_at":"2016-09-30T00:12:41Z","pushed_at":"2016-10-09T21:52:01Z","git_url":"git://github.com/juanjperez/azure-iot-dt-sdks.git","ssh_url":"git@github.com:juanjperez/azure-iot-dt-sdks.git","clone_url":"https://github.com/juanjperez/azure-iot-dt-sdks.git","svn_url":"https://github.com/juanjperez/azure-iot-dt-sdks","homepage":null,"size":39679,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"Azure:develop","ref":"develop","sha":"63caa29917a66b4635eab54bf9ee9907178151ce","user":{"login":"Azure","id":6844498,"avatar_url":"https://avatars.githubusercontent.com/u/6844498?v=3","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"repo":{"id":64692466,"name":"azure-iot-sdks-preview","full_name":"Azure/azure-iot-sdks-preview","owner":{"login":"Azure","id":6844498,"avatar_url":"https://avatars.githubusercontent.com/u/6844498?v=3","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Azure/azure-iot-sdks-preview","description":"IoT SDKs for Device Twin","fork":false,"url":"https://api.github.com/repos/Azure/azure-iot-sdks-preview","forks_url":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/forks","keys_url":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/teams","hooks_url":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/hooks","issue_events_url":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/issues/events{/number}","events_url":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/events","assignees_url":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/assignees{/user}","branches_url":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/branches{/branch}","tags_url":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/tags","blobs_url":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/git/refs{/sha}","trees_url":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/statuses/{sha}","languages_url":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/languages","stargazers_url":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/stargazers","contributors_url":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/contributors","subscribers_url":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/subscribers","subscription_url":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/subscription","commits_url":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/commits{/sha}","git_commits_url":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/git/commits{/sha}","comments_url":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/comments{/number}","issue_comment_url":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/issues/comments{/number}","contents_url":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/contents/{+path}","compare_url":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/merges","archive_url":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/downloads","issues_url":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/issues{/number}","pulls_url":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/pulls{/number}","milestones_url":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/milestones{/number}","notifications_url":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/labels{/name}","releases_url":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/releases{/id}","deployments_url":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/deployments","created_at":"2016-08-01T18:42:47Z","updated_at":"2016-10-07T20:58:04Z","pushed_at":"2016-10-11T18:19:15Z","git_url":"git://github.com/Azure/azure-iot-sdks-preview.git","ssh_url":"git@github.com:Azure/azure-iot-sdks-preview.git","clone_url":"https://github.com/Azure/azure-iot-sdks-preview.git","svn_url":"https://github.com/Azure/azure-iot-sdks-preview","homepage":null,"size":40360,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/pulls/2"},"html":{"href":"https://github.com/Azure/azure-iot-sdks-preview/pull/2"},"issue":{"href":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/issues/2"},"comments":{"href":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/Azure/azure-iot-sdks-preview/statuses/feff7292d2130fd11deb447b31222bdb6c4696d6"}}}}
{"actor":{"display_login":"juanjperez"}}