{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/pulls/comments/42663226","id":42663226,"diff_hunk":"@@ -1,4 +1,22 @@\n-module.exports = function restart(req, res) {\n-  // TODO\n-  res.status(501).send('501 Not Implemented');\n+let adb = require('./adb');\n+let parse = require('url').parse;\n+\n+module.exports = async function restart(req, res) {\n+  let params = parse(req.originalUrl, true /* parseQueryString */).query;\n+  let hard;","path":"src/restart.js","position":9,"original_position":9,"commit_id":"0b6e97f74ec1b843094b5f6f92b90db0f99dd7fc","original_commit_id":"0b6e97f74ec1b843094b5f6f92b90db0f99dd7fc","user":{"login":"eliperelman","id":285899,"avatar_url":"https://avatars.githubusercontent.com/u/285899?v=3","gravatar_id":"","url":"https://api.github.com/users/eliperelman","html_url":"https://github.com/eliperelman","followers_url":"https://api.github.com/users/eliperelman/followers","following_url":"https://api.github.com/users/eliperelman/following{/other_user}","gists_url":"https://api.github.com/users/eliperelman/gists{/gist_id}","starred_url":"https://api.github.com/users/eliperelman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eliperelman/subscriptions","organizations_url":"https://api.github.com/users/eliperelman/orgs","repos_url":"https://api.github.com/users/eliperelman/repos","events_url":"https://api.github.com/users/eliperelman/events{/privacy}","received_events_url":"https://api.github.com/users/eliperelman/received_events","type":"User","site_admin":false},"body":"```js\r\n...\r\nlet hard = params.hard ? false : JSON.parse();\r\nlet command = hard ? adb.reboot() : adb.shell('stop b2g && start b2g');\r\n...\r\n```","created_at":"2015-10-21T18:29:43Z","updated_at":"2015-10-21T18:29:43Z","html_url":"https://github.com/mozilla-b2g/fxos-device-service/pull/5#discussion_r42663226","pull_request_url":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/pulls/comments/42663226"},"html":{"href":"https://github.com/mozilla-b2g/fxos-device-service/pull/5#discussion_r42663226"},"pull_request":{"href":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/pulls/5","id":48366856,"html_url":"https://github.com/mozilla-b2g/fxos-device-service/pull/5","diff_url":"https://github.com/mozilla-b2g/fxos-device-service/pull/5.diff","patch_url":"https://github.com/mozilla-b2g/fxos-device-service/pull/5.patch","issue_url":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/issues/5","number":5,"state":"open","locked":false,"title":"Bug 1212109 - Implement /restart endpoint r=aus,Eli","user":{"login":"gaye","id":535859,"avatar_url":"https://avatars.githubusercontent.com/u/535859?v=3","gravatar_id":"","url":"https://api.github.com/users/gaye","html_url":"https://github.com/gaye","followers_url":"https://api.github.com/users/gaye/followers","following_url":"https://api.github.com/users/gaye/following{/other_user}","gists_url":"https://api.github.com/users/gaye/gists{/gist_id}","starred_url":"https://api.github.com/users/gaye/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaye/subscriptions","organizations_url":"https://api.github.com/users/gaye/orgs","repos_url":"https://api.github.com/users/gaye/repos","events_url":"https://api.github.com/users/gaye/events{/privacy}","received_events_url":"https://api.github.com/users/gaye/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-10-21T18:10:11Z","updated_at":"2015-10-21T18:29:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ac21bb7b14755f55fd950f14303442677311a658","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/pulls/5/commits","review_comments_url":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/pulls/5/comments","review_comment_url":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/issues/5/comments","statuses_url":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/statuses/0b6e97f74ec1b843094b5f6f92b90db0f99dd7fc","head":{"label":"gaye:implement-restart","ref":"implement-restart","sha":"0b6e97f74ec1b843094b5f6f92b90db0f99dd7fc","user":{"login":"gaye","id":535859,"avatar_url":"https://avatars.githubusercontent.com/u/535859?v=3","gravatar_id":"","url":"https://api.github.com/users/gaye","html_url":"https://github.com/gaye","followers_url":"https://api.github.com/users/gaye/followers","following_url":"https://api.github.com/users/gaye/following{/other_user}","gists_url":"https://api.github.com/users/gaye/gists{/gist_id}","starred_url":"https://api.github.com/users/gaye/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaye/subscriptions","organizations_url":"https://api.github.com/users/gaye/orgs","repos_url":"https://api.github.com/users/gaye/repos","events_url":"https://api.github.com/users/gaye/events{/privacy}","received_events_url":"https://api.github.com/users/gaye/received_events","type":"User","site_admin":false},"repo":{"id":43779029,"name":"fxos-device-service","full_name":"gaye/fxos-device-service","owner":{"login":"gaye","id":535859,"avatar_url":"https://avatars.githubusercontent.com/u/535859?v=3","gravatar_id":"","url":"https://api.github.com/users/gaye","html_url":"https://github.com/gaye","followers_url":"https://api.github.com/users/gaye/followers","following_url":"https://api.github.com/users/gaye/following{/other_user}","gists_url":"https://api.github.com/users/gaye/gists{/gist_id}","starred_url":"https://api.github.com/users/gaye/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaye/subscriptions","organizations_url":"https://api.github.com/users/gaye/orgs","repos_url":"https://api.github.com/users/gaye/repos","events_url":"https://api.github.com/users/gaye/events{/privacy}","received_events_url":"https://api.github.com/users/gaye/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gaye/fxos-device-service","description":"A web service that exposes interactions with a connected Firefox OS device","fork":true,"url":"https://api.github.com/repos/gaye/fxos-device-service","forks_url":"https://api.github.com/repos/gaye/fxos-device-service/forks","keys_url":"https://api.github.com/repos/gaye/fxos-device-service/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gaye/fxos-device-service/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gaye/fxos-device-service/teams","hooks_url":"https://api.github.com/repos/gaye/fxos-device-service/hooks","issue_events_url":"https://api.github.com/repos/gaye/fxos-device-service/issues/events{/number}","events_url":"https://api.github.com/repos/gaye/fxos-device-service/events","assignees_url":"https://api.github.com/repos/gaye/fxos-device-service/assignees{/user}","branches_url":"https://api.github.com/repos/gaye/fxos-device-service/branches{/branch}","tags_url":"https://api.github.com/repos/gaye/fxos-device-service/tags","blobs_url":"https://api.github.com/repos/gaye/fxos-device-service/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gaye/fxos-device-service/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gaye/fxos-device-service/git/refs{/sha}","trees_url":"https://api.github.com/repos/gaye/fxos-device-service/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gaye/fxos-device-service/statuses/{sha}","languages_url":"https://api.github.com/repos/gaye/fxos-device-service/languages","stargazers_url":"https://api.github.com/repos/gaye/fxos-device-service/stargazers","contributors_url":"https://api.github.com/repos/gaye/fxos-device-service/contributors","subscribers_url":"https://api.github.com/repos/gaye/fxos-device-service/subscribers","subscription_url":"https://api.github.com/repos/gaye/fxos-device-service/subscription","commits_url":"https://api.github.com/repos/gaye/fxos-device-service/commits{/sha}","git_commits_url":"https://api.github.com/repos/gaye/fxos-device-service/git/commits{/sha}","comments_url":"https://api.github.com/repos/gaye/fxos-device-service/comments{/number}","issue_comment_url":"https://api.github.com/repos/gaye/fxos-device-service/issues/comments{/number}","contents_url":"https://api.github.com/repos/gaye/fxos-device-service/contents/{+path}","compare_url":"https://api.github.com/repos/gaye/fxos-device-service/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gaye/fxos-device-service/merges","archive_url":"https://api.github.com/repos/gaye/fxos-device-service/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gaye/fxos-device-service/downloads","issues_url":"https://api.github.com/repos/gaye/fxos-device-service/issues{/number}","pulls_url":"https://api.github.com/repos/gaye/fxos-device-service/pulls{/number}","milestones_url":"https://api.github.com/repos/gaye/fxos-device-service/milestones{/number}","notifications_url":"https://api.github.com/repos/gaye/fxos-device-service/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gaye/fxos-device-service/labels{/name}","releases_url":"https://api.github.com/repos/gaye/fxos-device-service/releases{/id}","created_at":"2015-10-06T21:12:36Z","updated_at":"2015-10-21T17:05:10Z","pushed_at":"2015-10-21T18:11:05Z","git_url":"git://github.com/gaye/fxos-device-service.git","ssh_url":"git@github.com:gaye/fxos-device-service.git","clone_url":"https://github.com/gaye/fxos-device-service.git","svn_url":"https://github.com/gaye/fxos-device-service","homepage":null,"size":6035,"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":"master"}},"base":{"label":"mozilla-b2g:master","ref":"master","sha":"d5ee542cdab4398eed80df3f7cca903aff4c8031","user":{"login":"mozilla-b2g","id":1261292,"avatar_url":"https://avatars.githubusercontent.com/u/1261292?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-b2g","html_url":"https://github.com/mozilla-b2g","followers_url":"https://api.github.com/users/mozilla-b2g/followers","following_url":"https://api.github.com/users/mozilla-b2g/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-b2g/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-b2g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-b2g/subscriptions","organizations_url":"https://api.github.com/users/mozilla-b2g/orgs","repos_url":"https://api.github.com/users/mozilla-b2g/repos","events_url":"https://api.github.com/users/mozilla-b2g/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-b2g/received_events","type":"Organization","site_admin":false},"repo":{"id":43774860,"name":"fxos-device-service","full_name":"mozilla-b2g/fxos-device-service","owner":{"login":"mozilla-b2g","id":1261292,"avatar_url":"https://avatars.githubusercontent.com/u/1261292?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-b2g","html_url":"https://github.com/mozilla-b2g","followers_url":"https://api.github.com/users/mozilla-b2g/followers","following_url":"https://api.github.com/users/mozilla-b2g/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-b2g/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-b2g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-b2g/subscriptions","organizations_url":"https://api.github.com/users/mozilla-b2g/orgs","repos_url":"https://api.github.com/users/mozilla-b2g/repos","events_url":"https://api.github.com/users/mozilla-b2g/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-b2g/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla-b2g/fxos-device-service","description":"A web service that exposes interactions with a connected Firefox OS device","fork":false,"url":"https://api.github.com/repos/mozilla-b2g/fxos-device-service","forks_url":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/forks","keys_url":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/teams","hooks_url":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/hooks","issue_events_url":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/events","assignees_url":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/tags","blobs_url":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/languages","stargazers_url":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/stargazers","contributors_url":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/contributors","subscribers_url":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/subscribers","subscription_url":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/subscription","commits_url":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/merges","archive_url":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/downloads","issues_url":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/labels{/name}","releases_url":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/releases{/id}","created_at":"2015-10-06T19:55:57Z","updated_at":"2015-10-08T05:16:06Z","pushed_at":"2015-10-21T18:11:05Z","git_url":"git://github.com/mozilla-b2g/fxos-device-service.git","ssh_url":"git@github.com:mozilla-b2g/fxos-device-service.git","clone_url":"https://github.com/mozilla-b2g/fxos-device-service.git","svn_url":"https://github.com/mozilla-b2g/fxos-device-service","homepage":null,"size":6122,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/pulls/5"},"html":{"href":"https://github.com/mozilla-b2g/fxos-device-service/pull/5"},"issue":{"href":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/issues/5"},"comments":{"href":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla-b2g/fxos-device-service/statuses/0b6e97f74ec1b843094b5f6f92b90db0f99dd7fc"}}}}