{"action":"created","comment":{"url":"https://api.github.com/repos/rancherio/cattle/pulls/comments/31291476","id":31291476,"diff_hunk":"@@ -311,4 +313,91 @@ protected DnsEntryData map(List<Object> input) {\n                 .fetch().map(mapper);\n     }\n \n+\n+    @Override\n+    public List<DnsEntryData> getDnsServiceLinks(Instance instance) {\n+        MultiRecordMapper<DnsEntryData> mapper = new MultiRecordMapper<DnsEntryData>() {\n+            @Override\n+            protected DnsEntryData map(List<Object> input) {\n+                DnsEntryData data = new DnsEntryData();\n+                Map<String, List<String>> resolve = new HashMap<>();\n+                List<String> ips = new ArrayList<>();\n+                ips.add(((IpAddress) input.get(1)).getAddress());\n+                resolve.put(((Service) input.get(0)).getName(), ips);\n+                data.setSourceIpAddress((IpAddress) input.get(2));\n+                data.setResolve(resolve);\n+                data.setInstance((Instance) input.get(3));\n+                return data;\n+            }\n+        };\n+\n+        ServiceTable dnsService = mapper.add(SERVICE);\n+        IpAddressTable targetIpAddress = mapper.add(IP_ADDRESS);\n+        IpAddressTable clientIpAddress = mapper.add(IP_ADDRESS);\n+        InstanceTable clientInstance = mapper.add(INSTANCE);\n+        NicTable clientNic = NIC.as(\"client_nic\");\n+        NicTable targetNic = NIC.as(\"target_nic\");\n+        InstanceTable targetInstance = INSTANCE.as(\"instance\");\n+        IpAddressNicMapTable clientNicIpTable = IP_ADDRESS_NIC_MAP.as(\"client_nic_ip\");\n+        IpAddressNicMapTable targetNicIpTable = IP_ADDRESS_NIC_MAP.as(\"target_nic_ip\");\n+        ServiceExposeMapTable clientServiceExposeMap = SERVICE_EXPOSE_MAP.as(\"service_expose_map_client\");\n+        ServiceExposeMapTable targetServiceExposeMap = SERVICE_EXPOSE_MAP.as(\"service_expose_map_target\");\n+        ServiceConsumeMapTable dnsConsumeMap = SERVICE_CONSUME_MAP.as(\"dns_consume_map\");\n+        ServiceConsumeMapTable serviceConsumeMap = SERVICE_CONSUME_MAP.as(\"service_consume_map\");\n+\n+        return create()\n+                .select(mapper.fields())\n+                .from(NIC)\n+                .join(clientNic)\n+                .on(NIC.VNET_ID.eq(clientNic.VNET_ID))\n+                .join(clientServiceExposeMap)\n+                .on(clientServiceExposeMap.INSTANCE_ID.eq(clientNic.INSTANCE_ID))\n+                .join(dnsConsumeMap)\n+                .on(dnsConsumeMap.SERVICE_ID.eq(clientServiceExposeMap.SERVICE_ID))\n+                .join(dnsService)\n+                .on(dnsConsumeMap.CONSUMED_SERVICE_ID.eq(dnsService.ID))\n+                .join(serviceConsumeMap)\n+                .on(serviceConsumeMap.SERVICE_ID.eq(dnsService.ID))\n+                .join(targetServiceExposeMap)\n+                .on(targetServiceExposeMap.SERVICE_ID.eq(serviceConsumeMap.CONSUMED_SERVICE_ID))\n+                .join(targetNic)\n+                .on(targetNic.INSTANCE_ID.eq(targetServiceExposeMap.INSTANCE_ID))\n+                .join(targetInstance)\n+                .on(targetNic.INSTANCE_ID.eq(targetInstance.ID))\n+                .join(targetNicIpTable)\n+                .on(targetNicIpTable.NIC_ID.eq(targetNic.ID))\n+                .join(targetIpAddress)\n+                .on(targetNicIpTable.IP_ADDRESS_ID.eq(targetIpAddress.ID))\n+                .join(clientNicIpTable)\n+                .on(clientNicIpTable.NIC_ID.eq(clientNic.ID))\n+                .join(clientIpAddress)\n+                .on(clientNicIpTable.IP_ADDRESS_ID.eq(clientIpAddress.ID))\n+                .join(clientInstance)\n+                .on(clientNic.INSTANCE_ID.eq(clientInstance.ID))\n+                .where(NIC.INSTANCE_ID.eq(instance.getId())\n+                        .and(NIC.VNET_ID.isNotNull())\n+                        .and(NIC.REMOVED.isNull())\n+                        .and(targetIpAddress.ROLE.eq(IpAddressConstants.ROLE_PRIMARY))\n+                        .and(targetIpAddress.REMOVED.isNull())\n+                        .and(clientIpAddress.ROLE.eq(IpAddressConstants.ROLE_PRIMARY))\n+                        .and(clientIpAddress.REMOVED.isNull())\n+                        .and(targetNicIpTable.REMOVED.isNull())\n+                        .and(clientNic.REMOVED.isNull())\n+                        .and(targetNic.REMOVED.isNull())\n+                        .and(serviceConsumeMap.REMOVED.isNull())\n+                        .and(serviceConsumeMap.STATE.in(CommonStatesConstants.ACTIVATING,\n+                                CommonStatesConstants.ACTIVE))\n+                        .and(dnsConsumeMap.REMOVED.isNull())\n+                        .and(dnsConsumeMap.STATE.in(CommonStatesConstants.ACTIVATING,\n+                                CommonStatesConstants.ACTIVE))\n+                        .and(clientServiceExposeMap.REMOVED.isNull())\n+                        .and(targetServiceExposeMap.REMOVED.isNull())\n+                        .and(targetInstance.STATE.in(InstanceConstants.STATE_RUNNING,\n+                                InstanceConstants.STATE_STARTING))\n+                        .and(dnsService.KIND.eq(ServiceDiscoveryConstants.KIND.DNSSERVICE.name()))\n+                        .and(dnsService.STATE.in(CommonStatesConstants.ACTIVATING,\n+                                CommonStatesConstants.ACTIVE)))\n+                .fetch().map(mapper);","path":"code/iaas/config-item/server/src/main/java/io/cattle/platform/configitem/context/dao/impl/DnsInfoDaoImpl.java","position":104,"original_position":104,"commit_id":"801d3bc07b72ef1b07dc6749799671729e002080","original_commit_id":"801d3bc07b72ef1b07dc6749799671729e002080","user":{"login":"ibuildthecloud","id":1754002,"avatar_url":"https://avatars.githubusercontent.com/u/1754002?v=3","gravatar_id":"","url":"https://api.github.com/users/ibuildthecloud","html_url":"https://github.com/ibuildthecloud","followers_url":"https://api.github.com/users/ibuildthecloud/followers","following_url":"https://api.github.com/users/ibuildthecloud/following{/other_user}","gists_url":"https://api.github.com/users/ibuildthecloud/gists{/gist_id}","starred_url":"https://api.github.com/users/ibuildthecloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ibuildthecloud/subscriptions","organizations_url":"https://api.github.com/users/ibuildthecloud/orgs","repos_url":"https://api.github.com/users/ibuildthecloud/repos","events_url":"https://api.github.com/users/ibuildthecloud/events{/privacy}","received_events_url":"https://api.github.com/users/ibuildthecloud/received_events","type":"User","site_admin":false},"body":"um..... yeah.  I'll just pretend I know what that is doing.","created_at":"2015-05-29T00:42:22Z","updated_at":"2015-05-29T00:42:22Z","html_url":"https://github.com/rancherio/cattle/pull/512#discussion_r31291476","pull_request_url":"https://api.github.com/repos/rancherio/cattle/pulls/512","_links":{"self":{"href":"https://api.github.com/repos/rancherio/cattle/pulls/comments/31291476"},"html":{"href":"https://github.com/rancherio/cattle/pull/512#discussion_r31291476"},"pull_request":{"href":"https://api.github.com/repos/rancherio/cattle/pulls/512"}}},"pull_request":{"url":"https://api.github.com/repos/rancherio/cattle/pulls/512","id":36370620,"html_url":"https://github.com/rancherio/cattle/pull/512","diff_url":"https://github.com/rancherio/cattle/pull/512.diff","patch_url":"https://github.com/rancherio/cattle/pull/512.patch","issue_url":"https://api.github.com/repos/rancherio/cattle/issues/512","number":512,"state":"open","locked":false,"title":"DNS service","user":{"login":"alena1108","id":1562176,"avatar_url":"https://avatars.githubusercontent.com/u/1562176?v=3","gravatar_id":"","url":"https://api.github.com/users/alena1108","html_url":"https://github.com/alena1108","followers_url":"https://api.github.com/users/alena1108/followers","following_url":"https://api.github.com/users/alena1108/following{/other_user}","gists_url":"https://api.github.com/users/alena1108/gists{/gist_id}","starred_url":"https://api.github.com/users/alena1108/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alena1108/subscriptions","organizations_url":"https://api.github.com/users/alena1108/orgs","repos_url":"https://api.github.com/users/alena1108/repos","events_url":"https://api.github.com/users/alena1108/events{/privacy}","received_events_url":"https://api.github.com/users/alena1108/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-05-28T04:10:57Z","updated_at":"2015-05-29T00:42:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"33542d048bb17a4f23fbeffe42c26be91a63f301","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rancherio/cattle/pulls/512/commits","review_comments_url":"https://api.github.com/repos/rancherio/cattle/pulls/512/comments","review_comment_url":"https://api.github.com/repos/rancherio/cattle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rancherio/cattle/issues/512/comments","statuses_url":"https://api.github.com/repos/rancherio/cattle/statuses/801d3bc07b72ef1b07dc6749799671729e002080","head":{"label":"alena1108:dns_service","ref":"dns_service","sha":"801d3bc07b72ef1b07dc6749799671729e002080","user":{"login":"alena1108","id":1562176,"avatar_url":"https://avatars.githubusercontent.com/u/1562176?v=3","gravatar_id":"","url":"https://api.github.com/users/alena1108","html_url":"https://github.com/alena1108","followers_url":"https://api.github.com/users/alena1108/followers","following_url":"https://api.github.com/users/alena1108/following{/other_user}","gists_url":"https://api.github.com/users/alena1108/gists{/gist_id}","starred_url":"https://api.github.com/users/alena1108/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alena1108/subscriptions","organizations_url":"https://api.github.com/users/alena1108/orgs","repos_url":"https://api.github.com/users/alena1108/repos","events_url":"https://api.github.com/users/alena1108/events{/privacy}","received_events_url":"https://api.github.com/users/alena1108/received_events","type":"User","site_admin":false},"repo":{"id":28929339,"name":"cattle","full_name":"alena1108/cattle","owner":{"login":"alena1108","id":1562176,"avatar_url":"https://avatars.githubusercontent.com/u/1562176?v=3","gravatar_id":"","url":"https://api.github.com/users/alena1108","html_url":"https://github.com/alena1108","followers_url":"https://api.github.com/users/alena1108/followers","following_url":"https://api.github.com/users/alena1108/following{/other_user}","gists_url":"https://api.github.com/users/alena1108/gists{/gist_id}","starred_url":"https://api.github.com/users/alena1108/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alena1108/subscriptions","organizations_url":"https://api.github.com/users/alena1108/orgs","repos_url":"https://api.github.com/users/alena1108/repos","events_url":"https://api.github.com/users/alena1108/events{/privacy}","received_events_url":"https://api.github.com/users/alena1108/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alena1108/cattle","description":"Infrastructure orchestration platform","fork":true,"url":"https://api.github.com/repos/alena1108/cattle","forks_url":"https://api.github.com/repos/alena1108/cattle/forks","keys_url":"https://api.github.com/repos/alena1108/cattle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alena1108/cattle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alena1108/cattle/teams","hooks_url":"https://api.github.com/repos/alena1108/cattle/hooks","issue_events_url":"https://api.github.com/repos/alena1108/cattle/issues/events{/number}","events_url":"https://api.github.com/repos/alena1108/cattle/events","assignees_url":"https://api.github.com/repos/alena1108/cattle/assignees{/user}","branches_url":"https://api.github.com/repos/alena1108/cattle/branches{/branch}","tags_url":"https://api.github.com/repos/alena1108/cattle/tags","blobs_url":"https://api.github.com/repos/alena1108/cattle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alena1108/cattle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alena1108/cattle/git/refs{/sha}","trees_url":"https://api.github.com/repos/alena1108/cattle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alena1108/cattle/statuses/{sha}","languages_url":"https://api.github.com/repos/alena1108/cattle/languages","stargazers_url":"https://api.github.com/repos/alena1108/cattle/stargazers","contributors_url":"https://api.github.com/repos/alena1108/cattle/contributors","subscribers_url":"https://api.github.com/repos/alena1108/cattle/subscribers","subscription_url":"https://api.github.com/repos/alena1108/cattle/subscription","commits_url":"https://api.github.com/repos/alena1108/cattle/commits{/sha}","git_commits_url":"https://api.github.com/repos/alena1108/cattle/git/commits{/sha}","comments_url":"https://api.github.com/repos/alena1108/cattle/comments{/number}","issue_comment_url":"https://api.github.com/repos/alena1108/cattle/issues/comments{/number}","contents_url":"https://api.github.com/repos/alena1108/cattle/contents/{+path}","compare_url":"https://api.github.com/repos/alena1108/cattle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alena1108/cattle/merges","archive_url":"https://api.github.com/repos/alena1108/cattle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alena1108/cattle/downloads","issues_url":"https://api.github.com/repos/alena1108/cattle/issues{/number}","pulls_url":"https://api.github.com/repos/alena1108/cattle/pulls{/number}","milestones_url":"https://api.github.com/repos/alena1108/cattle/milestones{/number}","notifications_url":"https://api.github.com/repos/alena1108/cattle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alena1108/cattle/labels{/name}","releases_url":"https://api.github.com/repos/alena1108/cattle/releases{/id}","created_at":"2015-01-07T19:10:53Z","updated_at":"2015-01-12T17:27:50Z","pushed_at":"2015-05-28T22:44:11Z","git_url":"git://github.com/alena1108/cattle.git","ssh_url":"git@github.com:alena1108/cattle.git","clone_url":"https://github.com/alena1108/cattle.git","svn_url":"https://github.com/alena1108/cattle","homepage":"","size":19915,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"rancherio:master","ref":"master","sha":"1bf1ec0188b9dee39834210bcc17ae3c1f2ed8a5","user":{"login":"rancherio","id":9343010,"avatar_url":"https://avatars.githubusercontent.com/u/9343010?v=3","gravatar_id":"","url":"https://api.github.com/users/rancherio","html_url":"https://github.com/rancherio","followers_url":"https://api.github.com/users/rancherio/followers","following_url":"https://api.github.com/users/rancherio/following{/other_user}","gists_url":"https://api.github.com/users/rancherio/gists{/gist_id}","starred_url":"https://api.github.com/users/rancherio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rancherio/subscriptions","organizations_url":"https://api.github.com/users/rancherio/orgs","repos_url":"https://api.github.com/users/rancherio/repos","events_url":"https://api.github.com/users/rancherio/events{/privacy}","received_events_url":"https://api.github.com/users/rancherio/received_events","type":"Organization","site_admin":false},"repo":{"id":18023059,"name":"cattle","full_name":"rancherio/cattle","owner":{"login":"rancherio","id":9343010,"avatar_url":"https://avatars.githubusercontent.com/u/9343010?v=3","gravatar_id":"","url":"https://api.github.com/users/rancherio","html_url":"https://github.com/rancherio","followers_url":"https://api.github.com/users/rancherio/followers","following_url":"https://api.github.com/users/rancherio/following{/other_user}","gists_url":"https://api.github.com/users/rancherio/gists{/gist_id}","starred_url":"https://api.github.com/users/rancherio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rancherio/subscriptions","organizations_url":"https://api.github.com/users/rancherio/orgs","repos_url":"https://api.github.com/users/rancherio/repos","events_url":"https://api.github.com/users/rancherio/events{/privacy}","received_events_url":"https://api.github.com/users/rancherio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rancherio/cattle","description":"Infrastructure orchestration platform","fork":false,"url":"https://api.github.com/repos/rancherio/cattle","forks_url":"https://api.github.com/repos/rancherio/cattle/forks","keys_url":"https://api.github.com/repos/rancherio/cattle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rancherio/cattle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rancherio/cattle/teams","hooks_url":"https://api.github.com/repos/rancherio/cattle/hooks","issue_events_url":"https://api.github.com/repos/rancherio/cattle/issues/events{/number}","events_url":"https://api.github.com/repos/rancherio/cattle/events","assignees_url":"https://api.github.com/repos/rancherio/cattle/assignees{/user}","branches_url":"https://api.github.com/repos/rancherio/cattle/branches{/branch}","tags_url":"https://api.github.com/repos/rancherio/cattle/tags","blobs_url":"https://api.github.com/repos/rancherio/cattle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rancherio/cattle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rancherio/cattle/git/refs{/sha}","trees_url":"https://api.github.com/repos/rancherio/cattle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rancherio/cattle/statuses/{sha}","languages_url":"https://api.github.com/repos/rancherio/cattle/languages","stargazers_url":"https://api.github.com/repos/rancherio/cattle/stargazers","contributors_url":"https://api.github.com/repos/rancherio/cattle/contributors","subscribers_url":"https://api.github.com/repos/rancherio/cattle/subscribers","subscription_url":"https://api.github.com/repos/rancherio/cattle/subscription","commits_url":"https://api.github.com/repos/rancherio/cattle/commits{/sha}","git_commits_url":"https://api.github.com/repos/rancherio/cattle/git/commits{/sha}","comments_url":"https://api.github.com/repos/rancherio/cattle/comments{/number}","issue_comment_url":"https://api.github.com/repos/rancherio/cattle/issues/comments{/number}","contents_url":"https://api.github.com/repos/rancherio/cattle/contents/{+path}","compare_url":"https://api.github.com/repos/rancherio/cattle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rancherio/cattle/merges","archive_url":"https://api.github.com/repos/rancherio/cattle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rancherio/cattle/downloads","issues_url":"https://api.github.com/repos/rancherio/cattle/issues{/number}","pulls_url":"https://api.github.com/repos/rancherio/cattle/pulls{/number}","milestones_url":"https://api.github.com/repos/rancherio/cattle/milestones{/number}","notifications_url":"https://api.github.com/repos/rancherio/cattle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rancherio/cattle/labels{/name}","releases_url":"https://api.github.com/repos/rancherio/cattle/releases{/id}","created_at":"2014-03-23T00:19:52Z","updated_at":"2015-05-24T03:36:22Z","pushed_at":"2015-05-28T22:52:32Z","git_url":"git://github.com/rancherio/cattle.git","ssh_url":"git@github.com:rancherio/cattle.git","clone_url":"https://github.com/rancherio/cattle.git","svn_url":"https://github.com/rancherio/cattle","homepage":"","size":27714,"stargazers_count":138,"watchers_count":138,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":33,"mirror_url":null,"open_issues_count":88,"forks":33,"open_issues":88,"watchers":138,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rancherio/cattle/pulls/512"},"html":{"href":"https://github.com/rancherio/cattle/pull/512"},"issue":{"href":"https://api.github.com/repos/rancherio/cattle/issues/512"},"comments":{"href":"https://api.github.com/repos/rancherio/cattle/issues/512/comments"},"review_comments":{"href":"https://api.github.com/repos/rancherio/cattle/pulls/512/comments"},"review_comment":{"href":"https://api.github.com/repos/rancherio/cattle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rancherio/cattle/pulls/512/commits"},"statuses":{"href":"https://api.github.com/repos/rancherio/cattle/statuses/801d3bc07b72ef1b07dc6749799671729e002080"}}}}