{"action":"created","comment":{"url":"https://api.github.com/repos/flynn/flynn/pulls/comments/42065160","id":42065160,"diff_hunk":"@@ -0,0 +1,45 @@\n+package cli\n+\n+import (\n+\t\"errors\"\n+\t\"os\"\n+\t\"text/tabwriter\"\n+\n+\t\"github.com/flynn/flynn/Godeps/_workspace/src/github.com/flynn/go-docopt\"\n+\t\"github.com/flynn/flynn/pkg/cluster\"\n+)\n+\n+func init() {\n+\tRegister(\"list\", runListHosts, `\n+usage: flynn-host list\n+\n+Example:\n+\n+  $ flynn-host list\n+  ID    IP\n+  host  10.0.2.15:1113\n+\n+Lists ID and IP of each host`)\n+}\n+\n+func runListHosts(args *docopt.Args) error {\n+\tclusterClient := cluster.NewClient()\n+\thosts, err := clusterClient.Hosts()\n+\tif err != nil {\n+\t\treturn err\n+\t}\n+\tif len(hosts) == 0 {\n+\t\treturn errors.New(\"no hosts found\")\n+\t}\n+\n+\tw := tabwriter.NewWriter(os.Stdout, 1, 2, 2, ' ', 0)\n+\tdefer w.Flush()\n+\tlistRec(w,\n+\t\t\"ID\",\n+\t\t\"IP\",","path":"host/cli/list.go","position":39,"original_position":39,"commit_id":"8ee807cc5062b004fd65a60a07f48256c3d2be43","original_commit_id":"8ee807cc5062b004fd65a60a07f48256c3d2be43","user":{"login":"lmars","id":488515,"avatar_url":"https://avatars.githubusercontent.com/u/488515?v=3","gravatar_id":"","url":"https://api.github.com/users/lmars","html_url":"https://github.com/lmars","followers_url":"https://api.github.com/users/lmars/followers","following_url":"https://api.github.com/users/lmars/following{/other_user}","gists_url":"https://api.github.com/users/lmars/gists{/gist_id}","starred_url":"https://api.github.com/users/lmars/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmars/subscriptions","organizations_url":"https://api.github.com/users/lmars/orgs","repos_url":"https://api.github.com/users/lmars/repos","events_url":"https://api.github.com/users/lmars/events{/privacy}","received_events_url":"https://api.github.com/users/lmars/received_events","type":"User","site_admin":false},"body":"Looks like this field is actually a `host:port` pair, so maybe call it `ADDR`?","created_at":"2015-10-14T23:00:30Z","updated_at":"2015-10-14T23:00:30Z","html_url":"https://github.com/flynn/flynn/pull/1975#discussion_r42065160","pull_request_url":"https://api.github.com/repos/flynn/flynn/pulls/1975","_links":{"self":{"href":"https://api.github.com/repos/flynn/flynn/pulls/comments/42065160"},"html":{"href":"https://github.com/flynn/flynn/pull/1975#discussion_r42065160"},"pull_request":{"href":"https://api.github.com/repos/flynn/flynn/pulls/1975"}}},"pull_request":{"url":"https://api.github.com/repos/flynn/flynn/pulls/1975","id":47715991,"html_url":"https://github.com/flynn/flynn/pull/1975","diff_url":"https://github.com/flynn/flynn/pull/1975.diff","patch_url":"https://github.com/flynn/flynn/pull/1975.patch","issue_url":"https://api.github.com/repos/flynn/flynn/issues/1975","number":1975,"state":"open","locked":false,"title":"host: Add cli command for listing hosts","user":{"login":"jvatic","id":171040,"avatar_url":"https://avatars.githubusercontent.com/u/171040?v=3","gravatar_id":"","url":"https://api.github.com/users/jvatic","html_url":"https://github.com/jvatic","followers_url":"https://api.github.com/users/jvatic/followers","following_url":"https://api.github.com/users/jvatic/following{/other_user}","gists_url":"https://api.github.com/users/jvatic/gists{/gist_id}","starred_url":"https://api.github.com/users/jvatic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jvatic/subscriptions","organizations_url":"https://api.github.com/users/jvatic/orgs","repos_url":"https://api.github.com/users/jvatic/repos","events_url":"https://api.github.com/users/jvatic/events{/privacy}","received_events_url":"https://api.github.com/users/jvatic/received_events","type":"User","site_admin":false},"body":"Closes #460","created_at":"2015-10-14T21:15:27Z","updated_at":"2015-10-14T23:00:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5e989d65e1885950d2c3879dea673b66ea0382ac","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/flynn/flynn/pulls/1975/commits","review_comments_url":"https://api.github.com/repos/flynn/flynn/pulls/1975/comments","review_comment_url":"https://api.github.com/repos/flynn/flynn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/flynn/flynn/issues/1975/comments","statuses_url":"https://api.github.com/repos/flynn/flynn/statuses/8ee807cc5062b004fd65a60a07f48256c3d2be43","head":{"label":"flynn:host-list","ref":"host-list","sha":"8ee807cc5062b004fd65a60a07f48256c3d2be43","user":{"login":"flynn","id":4973613,"avatar_url":"https://avatars.githubusercontent.com/u/4973613?v=3","gravatar_id":"","url":"https://api.github.com/users/flynn","html_url":"https://github.com/flynn","followers_url":"https://api.github.com/users/flynn/followers","following_url":"https://api.github.com/users/flynn/following{/other_user}","gists_url":"https://api.github.com/users/flynn/gists{/gist_id}","starred_url":"https://api.github.com/users/flynn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flynn/subscriptions","organizations_url":"https://api.github.com/users/flynn/orgs","repos_url":"https://api.github.com/users/flynn/repos","events_url":"https://api.github.com/users/flynn/events{/privacy}","received_events_url":"https://api.github.com/users/flynn/received_events","type":"Organization","site_admin":false},"repo":{"id":11290232,"name":"flynn","full_name":"flynn/flynn","owner":{"login":"flynn","id":4973613,"avatar_url":"https://avatars.githubusercontent.com/u/4973613?v=3","gravatar_id":"","url":"https://api.github.com/users/flynn","html_url":"https://github.com/flynn","followers_url":"https://api.github.com/users/flynn/followers","following_url":"https://api.github.com/users/flynn/following{/other_user}","gists_url":"https://api.github.com/users/flynn/gists{/gist_id}","starred_url":"https://api.github.com/users/flynn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flynn/subscriptions","organizations_url":"https://api.github.com/users/flynn/orgs","repos_url":"https://api.github.com/users/flynn/repos","events_url":"https://api.github.com/users/flynn/events{/privacy}","received_events_url":"https://api.github.com/users/flynn/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/flynn/flynn","description":"A next generation open source platform as a service (PaaS)","fork":false,"url":"https://api.github.com/repos/flynn/flynn","forks_url":"https://api.github.com/repos/flynn/flynn/forks","keys_url":"https://api.github.com/repos/flynn/flynn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/flynn/flynn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/flynn/flynn/teams","hooks_url":"https://api.github.com/repos/flynn/flynn/hooks","issue_events_url":"https://api.github.com/repos/flynn/flynn/issues/events{/number}","events_url":"https://api.github.com/repos/flynn/flynn/events","assignees_url":"https://api.github.com/repos/flynn/flynn/assignees{/user}","branches_url":"https://api.github.com/repos/flynn/flynn/branches{/branch}","tags_url":"https://api.github.com/repos/flynn/flynn/tags","blobs_url":"https://api.github.com/repos/flynn/flynn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/flynn/flynn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/flynn/flynn/git/refs{/sha}","trees_url":"https://api.github.com/repos/flynn/flynn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/flynn/flynn/statuses/{sha}","languages_url":"https://api.github.com/repos/flynn/flynn/languages","stargazers_url":"https://api.github.com/repos/flynn/flynn/stargazers","contributors_url":"https://api.github.com/repos/flynn/flynn/contributors","subscribers_url":"https://api.github.com/repos/flynn/flynn/subscribers","subscription_url":"https://api.github.com/repos/flynn/flynn/subscription","commits_url":"https://api.github.com/repos/flynn/flynn/commits{/sha}","git_commits_url":"https://api.github.com/repos/flynn/flynn/git/commits{/sha}","comments_url":"https://api.github.com/repos/flynn/flynn/comments{/number}","issue_comment_url":"https://api.github.com/repos/flynn/flynn/issues/comments{/number}","contents_url":"https://api.github.com/repos/flynn/flynn/contents/{+path}","compare_url":"https://api.github.com/repos/flynn/flynn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/flynn/flynn/merges","archive_url":"https://api.github.com/repos/flynn/flynn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/flynn/flynn/downloads","issues_url":"https://api.github.com/repos/flynn/flynn/issues{/number}","pulls_url":"https://api.github.com/repos/flynn/flynn/pulls{/number}","milestones_url":"https://api.github.com/repos/flynn/flynn/milestones{/number}","notifications_url":"https://api.github.com/repos/flynn/flynn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/flynn/flynn/labels{/name}","releases_url":"https://api.github.com/repos/flynn/flynn/releases{/id}","created_at":"2013-07-09T18:22:06Z","updated_at":"2015-10-14T21:13:01Z","pushed_at":"2015-10-14T21:15:28Z","git_url":"git://github.com/flynn/flynn.git","ssh_url":"git@github.com:flynn/flynn.git","clone_url":"https://github.com/flynn/flynn.git","svn_url":"https://github.com/flynn/flynn","homepage":"https://flynn.io","size":59139,"stargazers_count":3932,"watchers_count":3932,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":282,"mirror_url":null,"open_issues_count":219,"forks":282,"open_issues":219,"watchers":3932,"default_branch":"master"}},"base":{"label":"flynn:master","ref":"master","sha":"dbe8964036414a316f77e7612fd52532d2e7aa9d","user":{"login":"flynn","id":4973613,"avatar_url":"https://avatars.githubusercontent.com/u/4973613?v=3","gravatar_id":"","url":"https://api.github.com/users/flynn","html_url":"https://github.com/flynn","followers_url":"https://api.github.com/users/flynn/followers","following_url":"https://api.github.com/users/flynn/following{/other_user}","gists_url":"https://api.github.com/users/flynn/gists{/gist_id}","starred_url":"https://api.github.com/users/flynn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flynn/subscriptions","organizations_url":"https://api.github.com/users/flynn/orgs","repos_url":"https://api.github.com/users/flynn/repos","events_url":"https://api.github.com/users/flynn/events{/privacy}","received_events_url":"https://api.github.com/users/flynn/received_events","type":"Organization","site_admin":false},"repo":{"id":11290232,"name":"flynn","full_name":"flynn/flynn","owner":{"login":"flynn","id":4973613,"avatar_url":"https://avatars.githubusercontent.com/u/4973613?v=3","gravatar_id":"","url":"https://api.github.com/users/flynn","html_url":"https://github.com/flynn","followers_url":"https://api.github.com/users/flynn/followers","following_url":"https://api.github.com/users/flynn/following{/other_user}","gists_url":"https://api.github.com/users/flynn/gists{/gist_id}","starred_url":"https://api.github.com/users/flynn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flynn/subscriptions","organizations_url":"https://api.github.com/users/flynn/orgs","repos_url":"https://api.github.com/users/flynn/repos","events_url":"https://api.github.com/users/flynn/events{/privacy}","received_events_url":"https://api.github.com/users/flynn/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/flynn/flynn","description":"A next generation open source platform as a service (PaaS)","fork":false,"url":"https://api.github.com/repos/flynn/flynn","forks_url":"https://api.github.com/repos/flynn/flynn/forks","keys_url":"https://api.github.com/repos/flynn/flynn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/flynn/flynn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/flynn/flynn/teams","hooks_url":"https://api.github.com/repos/flynn/flynn/hooks","issue_events_url":"https://api.github.com/repos/flynn/flynn/issues/events{/number}","events_url":"https://api.github.com/repos/flynn/flynn/events","assignees_url":"https://api.github.com/repos/flynn/flynn/assignees{/user}","branches_url":"https://api.github.com/repos/flynn/flynn/branches{/branch}","tags_url":"https://api.github.com/repos/flynn/flynn/tags","blobs_url":"https://api.github.com/repos/flynn/flynn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/flynn/flynn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/flynn/flynn/git/refs{/sha}","trees_url":"https://api.github.com/repos/flynn/flynn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/flynn/flynn/statuses/{sha}","languages_url":"https://api.github.com/repos/flynn/flynn/languages","stargazers_url":"https://api.github.com/repos/flynn/flynn/stargazers","contributors_url":"https://api.github.com/repos/flynn/flynn/contributors","subscribers_url":"https://api.github.com/repos/flynn/flynn/subscribers","subscription_url":"https://api.github.com/repos/flynn/flynn/subscription","commits_url":"https://api.github.com/repos/flynn/flynn/commits{/sha}","git_commits_url":"https://api.github.com/repos/flynn/flynn/git/commits{/sha}","comments_url":"https://api.github.com/repos/flynn/flynn/comments{/number}","issue_comment_url":"https://api.github.com/repos/flynn/flynn/issues/comments{/number}","contents_url":"https://api.github.com/repos/flynn/flynn/contents/{+path}","compare_url":"https://api.github.com/repos/flynn/flynn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/flynn/flynn/merges","archive_url":"https://api.github.com/repos/flynn/flynn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/flynn/flynn/downloads","issues_url":"https://api.github.com/repos/flynn/flynn/issues{/number}","pulls_url":"https://api.github.com/repos/flynn/flynn/pulls{/number}","milestones_url":"https://api.github.com/repos/flynn/flynn/milestones{/number}","notifications_url":"https://api.github.com/repos/flynn/flynn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/flynn/flynn/labels{/name}","releases_url":"https://api.github.com/repos/flynn/flynn/releases{/id}","created_at":"2013-07-09T18:22:06Z","updated_at":"2015-10-14T21:13:01Z","pushed_at":"2015-10-14T21:15:28Z","git_url":"git://github.com/flynn/flynn.git","ssh_url":"git@github.com:flynn/flynn.git","clone_url":"https://github.com/flynn/flynn.git","svn_url":"https://github.com/flynn/flynn","homepage":"https://flynn.io","size":59139,"stargazers_count":3932,"watchers_count":3932,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":282,"mirror_url":null,"open_issues_count":219,"forks":282,"open_issues":219,"watchers":3932,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/flynn/flynn/pulls/1975"},"html":{"href":"https://github.com/flynn/flynn/pull/1975"},"issue":{"href":"https://api.github.com/repos/flynn/flynn/issues/1975"},"comments":{"href":"https://api.github.com/repos/flynn/flynn/issues/1975/comments"},"review_comments":{"href":"https://api.github.com/repos/flynn/flynn/pulls/1975/comments"},"review_comment":{"href":"https://api.github.com/repos/flynn/flynn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/flynn/flynn/pulls/1975/commits"},"statuses":{"href":"https://api.github.com/repos/flynn/flynn/statuses/8ee807cc5062b004fd65a60a07f48256c3d2be43"}}}}