{"action":"created","comment":{"url":"https://api.github.com/repos/vmware/vic/pulls/comments/70091301","id":70091301,"diff_hunk":"@@ -262,6 +265,25 @@ func getImageCount(plClient *client.PortLayer) int {\n \treturn len(images)\n }\n \n+// Use the Portlayer's support for docker ps to get the container count\n func getContainerStatus(plClient *client.PortLayer) (ContainerStatus, error) {\n-\treturn ContainerStatus{0, 0, 0, 0}, nil\n+\tvar status ContainerStatus\n+\n+\tall := new(bool)\n+\t*all = true\n+\tcontainList, err := plClient.Containers.GetContainerList(containers.NewGetContainerListParams().WithAll(all))\n+\tif err != nil {\n+\t\treturn status, derr.NewErrorWithStatusCode(fmt.Errorf(\"Failed to get container list: %s\", err), http.StatusInternalServerError)\n+\t}\n+\n+\tfor _, t := range containList.Payload {\n+\t\tif *t.Status == \"Running\" {\n+\t\t\tstatus.numRunning++\n+\t\t} else if *t.Status == \"Stopped\" {\n+\t\t\tstatus.numStopped++\n+\t\t}\n+\t\tstatus.count++","path":"lib/apiservers/engine/backends/system.go","position":42,"original_position":42,"commit_id":"c0cf18f232403c2a200835232a6a649987e952ab","original_commit_id":"c0cf18f232403c2a200835232a6a649987e952ab","user":{"login":"jzt","id":128130,"avatar_url":"https://avatars.githubusercontent.com/u/128130?v=3","gravatar_id":"","url":"https://api.github.com/users/jzt","html_url":"https://github.com/jzt","followers_url":"https://api.github.com/users/jzt/followers","following_url":"https://api.github.com/users/jzt/following{/other_user}","gists_url":"https://api.github.com/users/jzt/gists{/gist_id}","starred_url":"https://api.github.com/users/jzt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jzt/subscriptions","organizations_url":"https://api.github.com/users/jzt/orgs","repos_url":"https://api.github.com/users/jzt/repos","events_url":"https://api.github.com/users/jzt/events{/privacy}","received_events_url":"https://api.github.com/users/jzt/received_events","type":"User","site_admin":false},"body":"Do we care about paused containers? We'd be counting them as well here, although I'm not sure we care about them right now. `numPaused` in the `ContainerStatus` struct seems to suggest so.","created_at":"2016-07-08T15:20:43Z","updated_at":"2016-07-08T15:20:43Z","html_url":"https://github.com/vmware/vic/pull/1391#discussion_r70091301","pull_request_url":"https://api.github.com/repos/vmware/vic/pulls/1391","_links":{"self":{"href":"https://api.github.com/repos/vmware/vic/pulls/comments/70091301"},"html":{"href":"https://github.com/vmware/vic/pull/1391#discussion_r70091301"},"pull_request":{"href":"https://api.github.com/repos/vmware/vic/pulls/1391"}}},"pull_request":{"url":"https://api.github.com/repos/vmware/vic/pulls/1391","id":76555411,"html_url":"https://github.com/vmware/vic/pull/1391","diff_url":"https://github.com/vmware/vic/pull/1391.diff","patch_url":"https://github.com/vmware/vic/pull/1391.patch","issue_url":"https://api.github.com/repos/vmware/vic/issues/1391","number":1391,"state":"open","locked":false,"title":"Get container count for docker info","user":{"login":"sflxn","id":1330508,"avatar_url":"https://avatars.githubusercontent.com/u/1330508?v=3","gravatar_id":"","url":"https://api.github.com/users/sflxn","html_url":"https://github.com/sflxn","followers_url":"https://api.github.com/users/sflxn/followers","following_url":"https://api.github.com/users/sflxn/following{/other_user}","gists_url":"https://api.github.com/users/sflxn/gists{/gist_id}","starred_url":"https://api.github.com/users/sflxn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sflxn/subscriptions","organizations_url":"https://api.github.com/users/sflxn/orgs","repos_url":"https://api.github.com/users/sflxn/repos","events_url":"https://api.github.com/users/sflxn/events{/privacy}","received_events_url":"https://api.github.com/users/sflxn/received_events","type":"User","site_admin":false},"body":"Use the docker ps infrastructure to retrieve container\r\ncount data for docker info.\r\n\r\nResolves #1389.","created_at":"2016-07-07T08:17:37Z","updated_at":"2016-07-08T15:20:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cc469a0f0ae38c9263cac26420979f4d9d743c7a","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/vmware/vic/pulls/1391/commits","review_comments_url":"https://api.github.com/repos/vmware/vic/pulls/1391/comments","review_comment_url":"https://api.github.com/repos/vmware/vic/pulls/comments{/number}","comments_url":"https://api.github.com/repos/vmware/vic/issues/1391/comments","statuses_url":"https://api.github.com/repos/vmware/vic/statuses/c0cf18f232403c2a200835232a6a649987e952ab","head":{"label":"sflxn:container-count","ref":"container-count","sha":"c0cf18f232403c2a200835232a6a649987e952ab","user":{"login":"sflxn","id":1330508,"avatar_url":"https://avatars.githubusercontent.com/u/1330508?v=3","gravatar_id":"","url":"https://api.github.com/users/sflxn","html_url":"https://github.com/sflxn","followers_url":"https://api.github.com/users/sflxn/followers","following_url":"https://api.github.com/users/sflxn/following{/other_user}","gists_url":"https://api.github.com/users/sflxn/gists{/gist_id}","starred_url":"https://api.github.com/users/sflxn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sflxn/subscriptions","organizations_url":"https://api.github.com/users/sflxn/orgs","repos_url":"https://api.github.com/users/sflxn/repos","events_url":"https://api.github.com/users/sflxn/events{/privacy}","received_events_url":"https://api.github.com/users/sflxn/received_events","type":"User","site_admin":false},"repo":{"id":55453338,"name":"vic","full_name":"sflxn/vic","owner":{"login":"sflxn","id":1330508,"avatar_url":"https://avatars.githubusercontent.com/u/1330508?v=3","gravatar_id":"","url":"https://api.github.com/users/sflxn","html_url":"https://github.com/sflxn","followers_url":"https://api.github.com/users/sflxn/followers","following_url":"https://api.github.com/users/sflxn/following{/other_user}","gists_url":"https://api.github.com/users/sflxn/gists{/gist_id}","starred_url":"https://api.github.com/users/sflxn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sflxn/subscriptions","organizations_url":"https://api.github.com/users/sflxn/orgs","repos_url":"https://api.github.com/users/sflxn/repos","events_url":"https://api.github.com/users/sflxn/events{/privacy}","received_events_url":"https://api.github.com/users/sflxn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sflxn/vic","description":"Integrated containers on vSphere","fork":true,"url":"https://api.github.com/repos/sflxn/vic","forks_url":"https://api.github.com/repos/sflxn/vic/forks","keys_url":"https://api.github.com/repos/sflxn/vic/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sflxn/vic/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sflxn/vic/teams","hooks_url":"https://api.github.com/repos/sflxn/vic/hooks","issue_events_url":"https://api.github.com/repos/sflxn/vic/issues/events{/number}","events_url":"https://api.github.com/repos/sflxn/vic/events","assignees_url":"https://api.github.com/repos/sflxn/vic/assignees{/user}","branches_url":"https://api.github.com/repos/sflxn/vic/branches{/branch}","tags_url":"https://api.github.com/repos/sflxn/vic/tags","blobs_url":"https://api.github.com/repos/sflxn/vic/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sflxn/vic/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sflxn/vic/git/refs{/sha}","trees_url":"https://api.github.com/repos/sflxn/vic/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sflxn/vic/statuses/{sha}","languages_url":"https://api.github.com/repos/sflxn/vic/languages","stargazers_url":"https://api.github.com/repos/sflxn/vic/stargazers","contributors_url":"https://api.github.com/repos/sflxn/vic/contributors","subscribers_url":"https://api.github.com/repos/sflxn/vic/subscribers","subscription_url":"https://api.github.com/repos/sflxn/vic/subscription","commits_url":"https://api.github.com/repos/sflxn/vic/commits{/sha}","git_commits_url":"https://api.github.com/repos/sflxn/vic/git/commits{/sha}","comments_url":"https://api.github.com/repos/sflxn/vic/comments{/number}","issue_comment_url":"https://api.github.com/repos/sflxn/vic/issues/comments{/number}","contents_url":"https://api.github.com/repos/sflxn/vic/contents/{+path}","compare_url":"https://api.github.com/repos/sflxn/vic/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sflxn/vic/merges","archive_url":"https://api.github.com/repos/sflxn/vic/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sflxn/vic/downloads","issues_url":"https://api.github.com/repos/sflxn/vic/issues{/number}","pulls_url":"https://api.github.com/repos/sflxn/vic/pulls{/number}","milestones_url":"https://api.github.com/repos/sflxn/vic/milestones{/number}","notifications_url":"https://api.github.com/repos/sflxn/vic/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sflxn/vic/labels{/name}","releases_url":"https://api.github.com/repos/sflxn/vic/releases{/id}","deployments_url":"https://api.github.com/repos/sflxn/vic/deployments","created_at":"2016-04-04T23:42:42Z","updated_at":"2016-04-04T23:42:44Z","pushed_at":"2016-07-07T20:44:49Z","git_url":"git://github.com/sflxn/vic.git","ssh_url":"git@github.com:sflxn/vic.git","clone_url":"https://github.com/sflxn/vic.git","svn_url":"https://github.com/sflxn/vic","homepage":null,"size":25959,"stargazers_count":0,"watchers_count":0,"language":"Go","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":"vmware:master","ref":"master","sha":"6e87d2f52e59b9a3de6fe40c613c31beb00b5bbe","user":{"login":"vmware","id":473334,"avatar_url":"https://avatars.githubusercontent.com/u/473334?v=3","gravatar_id":"","url":"https://api.github.com/users/vmware","html_url":"https://github.com/vmware","followers_url":"https://api.github.com/users/vmware/followers","following_url":"https://api.github.com/users/vmware/following{/other_user}","gists_url":"https://api.github.com/users/vmware/gists{/gist_id}","starred_url":"https://api.github.com/users/vmware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmware/subscriptions","organizations_url":"https://api.github.com/users/vmware/orgs","repos_url":"https://api.github.com/users/vmware/repos","events_url":"https://api.github.com/users/vmware/events{/privacy}","received_events_url":"https://api.github.com/users/vmware/received_events","type":"Organization","site_admin":false},"repo":{"id":49597898,"name":"vic","full_name":"vmware/vic","owner":{"login":"vmware","id":473334,"avatar_url":"https://avatars.githubusercontent.com/u/473334?v=3","gravatar_id":"","url":"https://api.github.com/users/vmware","html_url":"https://github.com/vmware","followers_url":"https://api.github.com/users/vmware/followers","following_url":"https://api.github.com/users/vmware/following{/other_user}","gists_url":"https://api.github.com/users/vmware/gists{/gist_id}","starred_url":"https://api.github.com/users/vmware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmware/subscriptions","organizations_url":"https://api.github.com/users/vmware/orgs","repos_url":"https://api.github.com/users/vmware/repos","events_url":"https://api.github.com/users/vmware/events{/privacy}","received_events_url":"https://api.github.com/users/vmware/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/vmware/vic","description":"Integrated containers on vSphere","fork":false,"url":"https://api.github.com/repos/vmware/vic","forks_url":"https://api.github.com/repos/vmware/vic/forks","keys_url":"https://api.github.com/repos/vmware/vic/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vmware/vic/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vmware/vic/teams","hooks_url":"https://api.github.com/repos/vmware/vic/hooks","issue_events_url":"https://api.github.com/repos/vmware/vic/issues/events{/number}","events_url":"https://api.github.com/repos/vmware/vic/events","assignees_url":"https://api.github.com/repos/vmware/vic/assignees{/user}","branches_url":"https://api.github.com/repos/vmware/vic/branches{/branch}","tags_url":"https://api.github.com/repos/vmware/vic/tags","blobs_url":"https://api.github.com/repos/vmware/vic/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vmware/vic/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vmware/vic/git/refs{/sha}","trees_url":"https://api.github.com/repos/vmware/vic/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vmware/vic/statuses/{sha}","languages_url":"https://api.github.com/repos/vmware/vic/languages","stargazers_url":"https://api.github.com/repos/vmware/vic/stargazers","contributors_url":"https://api.github.com/repos/vmware/vic/contributors","subscribers_url":"https://api.github.com/repos/vmware/vic/subscribers","subscription_url":"https://api.github.com/repos/vmware/vic/subscription","commits_url":"https://api.github.com/repos/vmware/vic/commits{/sha}","git_commits_url":"https://api.github.com/repos/vmware/vic/git/commits{/sha}","comments_url":"https://api.github.com/repos/vmware/vic/comments{/number}","issue_comment_url":"https://api.github.com/repos/vmware/vic/issues/comments{/number}","contents_url":"https://api.github.com/repos/vmware/vic/contents/{+path}","compare_url":"https://api.github.com/repos/vmware/vic/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vmware/vic/merges","archive_url":"https://api.github.com/repos/vmware/vic/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vmware/vic/downloads","issues_url":"https://api.github.com/repos/vmware/vic/issues{/number}","pulls_url":"https://api.github.com/repos/vmware/vic/pulls{/number}","milestones_url":"https://api.github.com/repos/vmware/vic/milestones{/number}","notifications_url":"https://api.github.com/repos/vmware/vic/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vmware/vic/labels{/name}","releases_url":"https://api.github.com/repos/vmware/vic/releases{/id}","deployments_url":"https://api.github.com/repos/vmware/vic/deployments","created_at":"2016-01-13T19:53:57Z","updated_at":"2016-07-08T01:47:59Z","pushed_at":"2016-07-08T14:29:54Z","git_url":"git://github.com/vmware/vic.git","ssh_url":"git@github.com:vmware/vic.git","clone_url":"https://github.com/vmware/vic.git","svn_url":"https://github.com/vmware/vic","homepage":null,"size":73310,"stargazers_count":99,"watchers_count":99,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":37,"mirror_url":null,"open_issues_count":438,"forks":37,"open_issues":438,"watchers":99,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/vmware/vic/pulls/1391"},"html":{"href":"https://github.com/vmware/vic/pull/1391"},"issue":{"href":"https://api.github.com/repos/vmware/vic/issues/1391"},"comments":{"href":"https://api.github.com/repos/vmware/vic/issues/1391/comments"},"review_comments":{"href":"https://api.github.com/repos/vmware/vic/pulls/1391/comments"},"review_comment":{"href":"https://api.github.com/repos/vmware/vic/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/vmware/vic/pulls/1391/commits"},"statuses":{"href":"https://api.github.com/repos/vmware/vic/statuses/c0cf18f232403c2a200835232a6a649987e952ab"}}}}
{"actor":{"display_login":"jzt"}}