{"action":"created","comment":{"url":"https://api.github.com/repos/spinnaker/clouddriver/pulls/comments/150746563","pull_request_review_id":76340504,"id":150746563,"diff_hunk":"@@ -160,9 +162,43 @@ class ServerGroupController {\n   @PostFilter(\"hasPermission(filterObject?.application, 'APPLICATION', 'READ')\")\n   @PostAuthorize(\"@authorizationSupport.filterForAccounts(returnObject)\")\n   @RequestMapping(value = \"/serverGroups\", method = RequestMethod.GET)\n-  List getServerGroupsByApplications(@RequestParam(value = 'applications') List<String> applications,\n-                                     @RequestParam(required = false, value = 'cloudProvider') String cloudProvider) {\n-    applications.collectMany { summaryList(it, cloudProvider) }\n+  List getServerGroups(@RequestParam(required = false, value = 'applications') List<String> applications,\n+                       @RequestParam(required = false, value = 'ids') List<String> ids,\n+                       @RequestParam(required = false, value = 'cloudProvider') String cloudProvider) {\n+    if ((applications && ids) || (!applications && !ids)) {\n+      throw new IllegalArgumentException(\"Provide either 'applications' or 'ids' parameter (but not both)\");\n+    }\n+\n+    if (applications) {\n+      return getServerGroupsForApplications(applications, cloudProvider)\n+    } else {\n+      return getServerGroupsForIds(ids)\n+    }\n+  }\n+\n+  private List<ServerGroupViewModel> getServerGroupsForApplications(List<String> applications, String cloudProvider) {\n+    return applications.collectMany { summaryList(it, cloudProvider) }\n+  }\n+\n+  private List<ServerGroupViewModel> getServerGroupsForIds(List<String> serverGroupIds) {\n+    String[][] allIdTokens = serverGroupIds.collect { it.split(':') }\n+\n+    def invalidIds = allIdTokens.findAll { it.size() != 3 }\n+    if (!invalidIds.empty) {","path":"clouddriver-web/src/main/groovy/com/netflix/spinnaker/clouddriver/controllers/ServerGroupController.groovy","position":54,"original_position":54,"commit_id":"b20e11353c0ebfe0a53dfbe17f277540e75834cc","original_commit_id":"b20e11353c0ebfe0a53dfbe17f277540e75834cc","user":{"login":"ajordens","id":388652,"avatar_url":"https://avatars0.githubusercontent.com/u/388652?v=4","gravatar_id":"","url":"https://api.github.com/users/ajordens","html_url":"https://github.com/ajordens","followers_url":"https://api.github.com/users/ajordens/followers","following_url":"https://api.github.com/users/ajordens/following{/other_user}","gists_url":"https://api.github.com/users/ajordens/gists{/gist_id}","starred_url":"https://api.github.com/users/ajordens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajordens/subscriptions","organizations_url":"https://api.github.com/users/ajordens/orgs","repos_url":"https://api.github.com/users/ajordens/repos","events_url":"https://api.github.com/users/ajordens/events{/privacy}","received_events_url":"https://api.github.com/users/ajordens/received_events","type":"User","site_admin":false},"body":"Can just be `if(invalidIds)`\r\n\r\n","created_at":"2017-11-14T06:25:29Z","updated_at":"2017-11-14T06:27:14Z","html_url":"https://github.com/spinnaker/clouddriver/pull/2114#discussion_r150746563","pull_request_url":"https://api.github.com/repos/spinnaker/clouddriver/pulls/2114","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/spinnaker/clouddriver/pulls/comments/150746563"},"html":{"href":"https://github.com/spinnaker/clouddriver/pull/2114#discussion_r150746563"},"pull_request":{"href":"https://api.github.com/repos/spinnaker/clouddriver/pulls/2114"}}},"pull_request":{"url":"https://api.github.com/repos/spinnaker/clouddriver/pulls/2114","id":152372547,"html_url":"https://github.com/spinnaker/clouddriver/pull/2114","diff_url":"https://github.com/spinnaker/clouddriver/pull/2114.diff","patch_url":"https://github.com/spinnaker/clouddriver/pull/2114.patch","issue_url":"https://api.github.com/repos/spinnaker/clouddriver/issues/2114","number":2114,"state":"open","locked":false,"title":"feat(core/search): Add parameter for fetching a batch of servergroups by name","user":{"login":"christopherthielen","id":2053478,"avatar_url":"https://avatars0.githubusercontent.com/u/2053478?v=4","gravatar_id":"","url":"https://api.github.com/users/christopherthielen","html_url":"https://github.com/christopherthielen","followers_url":"https://api.github.com/users/christopherthielen/followers","following_url":"https://api.github.com/users/christopherthielen/following{/other_user}","gists_url":"https://api.github.com/users/christopherthielen/gists{/gist_id}","starred_url":"https://api.github.com/users/christopherthielen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christopherthielen/subscriptions","organizations_url":"https://api.github.com/users/christopherthielen/orgs","repos_url":"https://api.github.com/users/christopherthielen/repos","events_url":"https://api.github.com/users/christopherthielen/events{/privacy}","received_events_url":"https://api.github.com/users/christopherthielen/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-11-13T23:09:56Z","updated_at":"2017-11-14T06:27:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"34094560ba9c77a743a38cac1547c2aa22664292","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/spinnaker/clouddriver/pulls/2114/commits","review_comments_url":"https://api.github.com/repos/spinnaker/clouddriver/pulls/2114/comments","review_comment_url":"https://api.github.com/repos/spinnaker/clouddriver/pulls/comments{/number}","comments_url":"https://api.github.com/repos/spinnaker/clouddriver/issues/2114/comments","statuses_url":"https://api.github.com/repos/spinnaker/clouddriver/statuses/b20e11353c0ebfe0a53dfbe17f277540e75834cc","head":{"label":"christopherthielen:multiple-server-groups-by-name","ref":"multiple-server-groups-by-name","sha":"b20e11353c0ebfe0a53dfbe17f277540e75834cc","user":{"login":"christopherthielen","id":2053478,"avatar_url":"https://avatars0.githubusercontent.com/u/2053478?v=4","gravatar_id":"","url":"https://api.github.com/users/christopherthielen","html_url":"https://github.com/christopherthielen","followers_url":"https://api.github.com/users/christopherthielen/followers","following_url":"https://api.github.com/users/christopherthielen/following{/other_user}","gists_url":"https://api.github.com/users/christopherthielen/gists{/gist_id}","starred_url":"https://api.github.com/users/christopherthielen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christopherthielen/subscriptions","organizations_url":"https://api.github.com/users/christopherthielen/orgs","repos_url":"https://api.github.com/users/christopherthielen/repos","events_url":"https://api.github.com/users/christopherthielen/events{/privacy}","received_events_url":"https://api.github.com/users/christopherthielen/received_events","type":"User","site_admin":false},"repo":{"id":89395794,"name":"clouddriver","full_name":"christopherthielen/clouddriver","owner":{"login":"christopherthielen","id":2053478,"avatar_url":"https://avatars0.githubusercontent.com/u/2053478?v=4","gravatar_id":"","url":"https://api.github.com/users/christopherthielen","html_url":"https://github.com/christopherthielen","followers_url":"https://api.github.com/users/christopherthielen/followers","following_url":"https://api.github.com/users/christopherthielen/following{/other_user}","gists_url":"https://api.github.com/users/christopherthielen/gists{/gist_id}","starred_url":"https://api.github.com/users/christopherthielen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christopherthielen/subscriptions","organizations_url":"https://api.github.com/users/christopherthielen/orgs","repos_url":"https://api.github.com/users/christopherthielen/repos","events_url":"https://api.github.com/users/christopherthielen/events{/privacy}","received_events_url":"https://api.github.com/users/christopherthielen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/christopherthielen/clouddriver","description":"read and write operations across cloud providers","fork":true,"url":"https://api.github.com/repos/christopherthielen/clouddriver","forks_url":"https://api.github.com/repos/christopherthielen/clouddriver/forks","keys_url":"https://api.github.com/repos/christopherthielen/clouddriver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/christopherthielen/clouddriver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/christopherthielen/clouddriver/teams","hooks_url":"https://api.github.com/repos/christopherthielen/clouddriver/hooks","issue_events_url":"https://api.github.com/repos/christopherthielen/clouddriver/issues/events{/number}","events_url":"https://api.github.com/repos/christopherthielen/clouddriver/events","assignees_url":"https://api.github.com/repos/christopherthielen/clouddriver/assignees{/user}","branches_url":"https://api.github.com/repos/christopherthielen/clouddriver/branches{/branch}","tags_url":"https://api.github.com/repos/christopherthielen/clouddriver/tags","blobs_url":"https://api.github.com/repos/christopherthielen/clouddriver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/christopherthielen/clouddriver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/christopherthielen/clouddriver/git/refs{/sha}","trees_url":"https://api.github.com/repos/christopherthielen/clouddriver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/christopherthielen/clouddriver/statuses/{sha}","languages_url":"https://api.github.com/repos/christopherthielen/clouddriver/languages","stargazers_url":"https://api.github.com/repos/christopherthielen/clouddriver/stargazers","contributors_url":"https://api.github.com/repos/christopherthielen/clouddriver/contributors","subscribers_url":"https://api.github.com/repos/christopherthielen/clouddriver/subscribers","subscription_url":"https://api.github.com/repos/christopherthielen/clouddriver/subscription","commits_url":"https://api.github.com/repos/christopherthielen/clouddriver/commits{/sha}","git_commits_url":"https://api.github.com/repos/christopherthielen/clouddriver/git/commits{/sha}","comments_url":"https://api.github.com/repos/christopherthielen/clouddriver/comments{/number}","issue_comment_url":"https://api.github.com/repos/christopherthielen/clouddriver/issues/comments{/number}","contents_url":"https://api.github.com/repos/christopherthielen/clouddriver/contents/{+path}","compare_url":"https://api.github.com/repos/christopherthielen/clouddriver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/christopherthielen/clouddriver/merges","archive_url":"https://api.github.com/repos/christopherthielen/clouddriver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/christopherthielen/clouddriver/downloads","issues_url":"https://api.github.com/repos/christopherthielen/clouddriver/issues{/number}","pulls_url":"https://api.github.com/repos/christopherthielen/clouddriver/pulls{/number}","milestones_url":"https://api.github.com/repos/christopherthielen/clouddriver/milestones{/number}","notifications_url":"https://api.github.com/repos/christopherthielen/clouddriver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/christopherthielen/clouddriver/labels{/name}","releases_url":"https://api.github.com/repos/christopherthielen/clouddriver/releases{/id}","deployments_url":"https://api.github.com/repos/christopherthielen/clouddriver/deployments","created_at":"2017-04-25T18:54:03Z","updated_at":"2017-04-25T18:54:11Z","pushed_at":"2017-11-14T05:34:16Z","git_url":"git://github.com/christopherthielen/clouddriver.git","ssh_url":"git@github.com:christopherthielen/clouddriver.git","clone_url":"https://github.com/christopherthielen/clouddriver.git","svn_url":"https://github.com/christopherthielen/clouddriver","homepage":null,"size":33283,"stargazers_count":0,"watchers_count":0,"language":"Groovy","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"spinnaker:master","ref":"master","sha":"408576a808260a39c5987c69e7f709fbccfd35f0","user":{"login":"spinnaker","id":7634182,"avatar_url":"https://avatars1.githubusercontent.com/u/7634182?v=4","gravatar_id":"","url":"https://api.github.com/users/spinnaker","html_url":"https://github.com/spinnaker","followers_url":"https://api.github.com/users/spinnaker/followers","following_url":"https://api.github.com/users/spinnaker/following{/other_user}","gists_url":"https://api.github.com/users/spinnaker/gists{/gist_id}","starred_url":"https://api.github.com/users/spinnaker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spinnaker/subscriptions","organizations_url":"https://api.github.com/users/spinnaker/orgs","repos_url":"https://api.github.com/users/spinnaker/repos","events_url":"https://api.github.com/users/spinnaker/events{/privacy}","received_events_url":"https://api.github.com/users/spinnaker/received_events","type":"Organization","site_admin":false},"repo":{"id":37556951,"name":"clouddriver","full_name":"spinnaker/clouddriver","owner":{"login":"spinnaker","id":7634182,"avatar_url":"https://avatars1.githubusercontent.com/u/7634182?v=4","gravatar_id":"","url":"https://api.github.com/users/spinnaker","html_url":"https://github.com/spinnaker","followers_url":"https://api.github.com/users/spinnaker/followers","following_url":"https://api.github.com/users/spinnaker/following{/other_user}","gists_url":"https://api.github.com/users/spinnaker/gists{/gist_id}","starred_url":"https://api.github.com/users/spinnaker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spinnaker/subscriptions","organizations_url":"https://api.github.com/users/spinnaker/orgs","repos_url":"https://api.github.com/users/spinnaker/repos","events_url":"https://api.github.com/users/spinnaker/events{/privacy}","received_events_url":"https://api.github.com/users/spinnaker/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/spinnaker/clouddriver","description":"read and write operations across cloud providers","fork":false,"url":"https://api.github.com/repos/spinnaker/clouddriver","forks_url":"https://api.github.com/repos/spinnaker/clouddriver/forks","keys_url":"https://api.github.com/repos/spinnaker/clouddriver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spinnaker/clouddriver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spinnaker/clouddriver/teams","hooks_url":"https://api.github.com/repos/spinnaker/clouddriver/hooks","issue_events_url":"https://api.github.com/repos/spinnaker/clouddriver/issues/events{/number}","events_url":"https://api.github.com/repos/spinnaker/clouddriver/events","assignees_url":"https://api.github.com/repos/spinnaker/clouddriver/assignees{/user}","branches_url":"https://api.github.com/repos/spinnaker/clouddriver/branches{/branch}","tags_url":"https://api.github.com/repos/spinnaker/clouddriver/tags","blobs_url":"https://api.github.com/repos/spinnaker/clouddriver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spinnaker/clouddriver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spinnaker/clouddriver/git/refs{/sha}","trees_url":"https://api.github.com/repos/spinnaker/clouddriver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spinnaker/clouddriver/statuses/{sha}","languages_url":"https://api.github.com/repos/spinnaker/clouddriver/languages","stargazers_url":"https://api.github.com/repos/spinnaker/clouddriver/stargazers","contributors_url":"https://api.github.com/repos/spinnaker/clouddriver/contributors","subscribers_url":"https://api.github.com/repos/spinnaker/clouddriver/subscribers","subscription_url":"https://api.github.com/repos/spinnaker/clouddriver/subscription","commits_url":"https://api.github.com/repos/spinnaker/clouddriver/commits{/sha}","git_commits_url":"https://api.github.com/repos/spinnaker/clouddriver/git/commits{/sha}","comments_url":"https://api.github.com/repos/spinnaker/clouddriver/comments{/number}","issue_comment_url":"https://api.github.com/repos/spinnaker/clouddriver/issues/comments{/number}","contents_url":"https://api.github.com/repos/spinnaker/clouddriver/contents/{+path}","compare_url":"https://api.github.com/repos/spinnaker/clouddriver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spinnaker/clouddriver/merges","archive_url":"https://api.github.com/repos/spinnaker/clouddriver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spinnaker/clouddriver/downloads","issues_url":"https://api.github.com/repos/spinnaker/clouddriver/issues{/number}","pulls_url":"https://api.github.com/repos/spinnaker/clouddriver/pulls{/number}","milestones_url":"https://api.github.com/repos/spinnaker/clouddriver/milestones{/number}","notifications_url":"https://api.github.com/repos/spinnaker/clouddriver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spinnaker/clouddriver/labels{/name}","releases_url":"https://api.github.com/repos/spinnaker/clouddriver/releases{/id}","deployments_url":"https://api.github.com/repos/spinnaker/clouddriver/deployments","created_at":"2015-06-16T21:26:02Z","updated_at":"2017-11-13T15:39:18Z","pushed_at":"2017-11-14T05:34:20Z","git_url":"git://github.com/spinnaker/clouddriver.git","ssh_url":"git@github.com:spinnaker/clouddriver.git","clone_url":"https://github.com/spinnaker/clouddriver.git","svn_url":"https://github.com/spinnaker/clouddriver","homepage":null,"size":37365,"stargazers_count":114,"watchers_count":114,"language":"Groovy","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":216,"mirror_url":null,"archived":false,"open_issues_count":9,"forks":216,"open_issues":9,"watchers":114,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/spinnaker/clouddriver/pulls/2114"},"html":{"href":"https://github.com/spinnaker/clouddriver/pull/2114"},"issue":{"href":"https://api.github.com/repos/spinnaker/clouddriver/issues/2114"},"comments":{"href":"https://api.github.com/repos/spinnaker/clouddriver/issues/2114/comments"},"review_comments":{"href":"https://api.github.com/repos/spinnaker/clouddriver/pulls/2114/comments"},"review_comment":{"href":"https://api.github.com/repos/spinnaker/clouddriver/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/spinnaker/clouddriver/pulls/2114/commits"},"statuses":{"href":"https://api.github.com/repos/spinnaker/clouddriver/statuses/b20e11353c0ebfe0a53dfbe17f277540e75834cc"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ajordens"}}