{"action":"created","comment":{"url":"https://api.github.com/repos/Azure/azure-sdk-for-java/pulls/comments/66114736","id":66114736,"diff_hunk":"@@ -257,78 +252,75 @@ public String internalFqdn() {\n     }\n \n     @Override\n-    public String publicIpAddressId() {\n-        if (this.primaryIpConfiguration().publicIPAddress() == null) {\n-            return null;\n-        }\n-        return this.primaryIpConfiguration().publicIPAddress().id();\n+    public PublicIpAddress primaryPublicIpAddress() throws CloudException, IOException {\n+        return this.primaryIpConfiguration().publicIpAddress();\n     }\n \n     @Override\n-    public PublicIpAddress publicIpAddress() throws CloudException, IOException {\n-        String id = publicIpAddressId();\n-        if (id == null) {\n-            return null;\n-        }\n-\n-        return this.publicIpAddresses.get(ResourceUtils.groupFromResourceId(id), ResourceUtils.nameFromResourceId(id));\n+    public String primarySubnetId() {\n+        return this.primaryIpConfiguration().subnetId();\n     }\n \n     @Override\n-    public String subnetId() {\n-        return this.primaryIpConfiguration().subnet().id();\n+    public Network primaryNetwork() throws CloudException, IOException {\n+        return this.primaryIpConfiguration().network();\n     }\n \n     @Override\n-    public Network network() throws CloudException, IOException {\n-        String id = subnetId();\n-        return this.networks.get(ResourceUtils.groupFromResourceId(id), ResourceUtils.extractFromResourceId(id, \"virtualNetworks\"));\n+    public String primaryPrivateIp() {\n+        return this.primaryIpConfiguration().privateIp();\n     }\n \n     @Override\n-    public String privateIp() {\n-        return this.primaryIpConfiguration().privateIPAddress();\n+    public String primaryPrivateIpAllocationMethod() {\n+        return this.primaryIpConfiguration().privateIpAllocationMethod();\n     }\n \n     @Override\n-    public String privateIpAllocationMethod() {\n-        return this.primaryIpConfiguration().privateIPAllocationMethod();\n+    public List<NicIpConfiguration> ipConfigurations() {\n+        return Collections.unmodifiableList(this.nicIpConfigurations);\n     }\n \n-\n     /**************************************************.\n      * CreatableImpl::createResource\n      **************************************************/\n \n     @Override\n     protected void createResource() throws Exception {\n-        this.primaryIpConfiguration().setSubnet(subnetToAssociate());\n-        this.primaryIpConfiguration().setPublicIPAddress(publicIpToAssociate());\n-        ServiceResponse<NetworkInterfaceInner> response = this.client.createOrUpdate(this.resourceGroupName(), this.nicName, this.inner());\n+        for (NicIpConfiguration ipConfig : this.nicIpConfigurations) {\n+            ((NicIpConfigurationImpl)ipConfig).ensureConfiguration();\n+        }\n+\n+        ServiceResponse<NetworkInterfaceInner> response = this.client.createOrUpdate(this.resourceGroupName(),\n+                this.nicName,\n+                this.inner());\n         this.setInner(response.getBody());\n+        initializeNicIpConfigurations();\n     }\n \n     /**************************************************.\n      * Helper methods\n      **************************************************/\n \n     /**\n-     * @param prefix the prefix\n-     * @return a random value (derived from the resource and resource group name) with the given prefix\n-     */\n-    private String nameWithPrefix(String prefix) {\n-        return prefix + \"-\" + this.randomId + \"-\" + this.resourceGroupName();\n-    }\n-\n-    /**\n      * @return the primary IP configuration of the network interface\n      */\n-    private NetworkInterfaceIPConfiguration primaryIpConfiguration() {\n-        if (this.inner().ipConfigurations().size() == 0) {\n-            this.inner().ipConfigurations().add(new NetworkInterfaceIPConfiguration());\n-            this.inner().ipConfigurations().get(0).setName(\"primary-nic-config\");\n+    private NicIpConfigurationImpl primaryIpConfiguration() {","path":"azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkInterfaceImpl.java","position":302,"original_position":302,"commit_id":"2f39e4bcb49a406dd8e4b37ca308b18ca9d11cda","original_commit_id":"2f39e4bcb49a406dd8e4b37ca308b18ca9d11cda","user":{"login":"jianghaolu","id":2320445,"avatar_url":"https://avatars.githubusercontent.com/u/2320445?v=3","gravatar_id":"","url":"https://api.github.com/users/jianghaolu","html_url":"https://github.com/jianghaolu","followers_url":"https://api.github.com/users/jianghaolu/followers","following_url":"https://api.github.com/users/jianghaolu/following{/other_user}","gists_url":"https://api.github.com/users/jianghaolu/gists{/gist_id}","starred_url":"https://api.github.com/users/jianghaolu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jianghaolu/subscriptions","organizations_url":"https://api.github.com/users/jianghaolu/orgs","repos_url":"https://api.github.com/users/jianghaolu/repos","events_url":"https://api.github.com/users/jianghaolu/events{/privacy}","received_events_url":"https://api.github.com/users/jianghaolu/received_events","type":"User","site_admin":false},"body":"Somehow the comments became outdated.\r\nSince this method is not throwing `CloudException` & `IOException`, the other ones that call this shouldn't declare `throws` either?","created_at":"2016-06-07T17:25:26Z","updated_at":"2016-06-07T17:25:26Z","html_url":"https://github.com/Azure/azure-sdk-for-java/pull/770#discussion_r66114736","pull_request_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/pulls/770","_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-sdk-for-java/pulls/comments/66114736"},"html":{"href":"https://github.com/Azure/azure-sdk-for-java/pull/770#discussion_r66114736"},"pull_request":{"href":"https://api.github.com/repos/Azure/azure-sdk-for-java/pulls/770"}}},"pull_request":{"url":"https://api.github.com/repos/Azure/azure-sdk-for-java/pulls/770","id":72760375,"html_url":"https://github.com/Azure/azure-sdk-for-java/pull/770","diff_url":"https://github.com/Azure/azure-sdk-for-java/pull/770.diff","patch_url":"https://github.com/Azure/azure-sdk-for-java/pull/770.patch","issue_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/issues/770","number":770,"state":"open","locked":false,"title":"Support for mutiple NIC Ip configurations, modeling Ip confgiuration …","user":{"login":"anuchandy","id":1471612,"avatar_url":"https://avatars.githubusercontent.com/u/1471612?v=3","gravatar_id":"","url":"https://api.github.com/users/anuchandy","html_url":"https://github.com/anuchandy","followers_url":"https://api.github.com/users/anuchandy/followers","following_url":"https://api.github.com/users/anuchandy/following{/other_user}","gists_url":"https://api.github.com/users/anuchandy/gists{/gist_id}","starred_url":"https://api.github.com/users/anuchandy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anuchandy/subscriptions","organizations_url":"https://api.github.com/users/anuchandy/orgs","repos_url":"https://api.github.com/users/anuchandy/repos","events_url":"https://api.github.com/users/anuchandy/events{/privacy}","received_events_url":"https://api.github.com/users/anuchandy/received_events","type":"User","site_admin":false},"body":"…as child resource\r\n\r\nsee https://github.com/Azure/azure-sdk-for-java/issues/769 for more details.","created_at":"2016-06-06T19:03:53Z","updated_at":"2016-06-07T17:25:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4305a7542640b3761acfb380c0260e6a5df43cf7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/pulls/770/commits","review_comments_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/pulls/770/comments","review_comment_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/issues/770/comments","statuses_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/statuses/2f39e4bcb49a406dd8e4b37ca308b18ca9d11cda","head":{"label":"anuchandy:nic-rework","ref":"nic-rework","sha":"2f39e4bcb49a406dd8e4b37ca308b18ca9d11cda","user":{"login":"anuchandy","id":1471612,"avatar_url":"https://avatars.githubusercontent.com/u/1471612?v=3","gravatar_id":"","url":"https://api.github.com/users/anuchandy","html_url":"https://github.com/anuchandy","followers_url":"https://api.github.com/users/anuchandy/followers","following_url":"https://api.github.com/users/anuchandy/following{/other_user}","gists_url":"https://api.github.com/users/anuchandy/gists{/gist_id}","starred_url":"https://api.github.com/users/anuchandy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anuchandy/subscriptions","organizations_url":"https://api.github.com/users/anuchandy/orgs","repos_url":"https://api.github.com/users/anuchandy/repos","events_url":"https://api.github.com/users/anuchandy/events{/privacy}","received_events_url":"https://api.github.com/users/anuchandy/received_events","type":"User","site_admin":false},"repo":{"id":58091949,"name":"azure-sdk-for-java","full_name":"anuchandy/azure-sdk-for-java","owner":{"login":"anuchandy","id":1471612,"avatar_url":"https://avatars.githubusercontent.com/u/1471612?v=3","gravatar_id":"","url":"https://api.github.com/users/anuchandy","html_url":"https://github.com/anuchandy","followers_url":"https://api.github.com/users/anuchandy/followers","following_url":"https://api.github.com/users/anuchandy/following{/other_user}","gists_url":"https://api.github.com/users/anuchandy/gists{/gist_id}","starred_url":"https://api.github.com/users/anuchandy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anuchandy/subscriptions","organizations_url":"https://api.github.com/users/anuchandy/orgs","repos_url":"https://api.github.com/users/anuchandy/repos","events_url":"https://api.github.com/users/anuchandy/events{/privacy}","received_events_url":"https://api.github.com/users/anuchandy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/anuchandy/azure-sdk-for-java","description":"Microsoft Azure SDK for Java","fork":true,"url":"https://api.github.com/repos/anuchandy/azure-sdk-for-java","forks_url":"https://api.github.com/repos/anuchandy/azure-sdk-for-java/forks","keys_url":"https://api.github.com/repos/anuchandy/azure-sdk-for-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/anuchandy/azure-sdk-for-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/anuchandy/azure-sdk-for-java/teams","hooks_url":"https://api.github.com/repos/anuchandy/azure-sdk-for-java/hooks","issue_events_url":"https://api.github.com/repos/anuchandy/azure-sdk-for-java/issues/events{/number}","events_url":"https://api.github.com/repos/anuchandy/azure-sdk-for-java/events","assignees_url":"https://api.github.com/repos/anuchandy/azure-sdk-for-java/assignees{/user}","branches_url":"https://api.github.com/repos/anuchandy/azure-sdk-for-java/branches{/branch}","tags_url":"https://api.github.com/repos/anuchandy/azure-sdk-for-java/tags","blobs_url":"https://api.github.com/repos/anuchandy/azure-sdk-for-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/anuchandy/azure-sdk-for-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/anuchandy/azure-sdk-for-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/anuchandy/azure-sdk-for-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/anuchandy/azure-sdk-for-java/statuses/{sha}","languages_url":"https://api.github.com/repos/anuchandy/azure-sdk-for-java/languages","stargazers_url":"https://api.github.com/repos/anuchandy/azure-sdk-for-java/stargazers","contributors_url":"https://api.github.com/repos/anuchandy/azure-sdk-for-java/contributors","subscribers_url":"https://api.github.com/repos/anuchandy/azure-sdk-for-java/subscribers","subscription_url":"https://api.github.com/repos/anuchandy/azure-sdk-for-java/subscription","commits_url":"https://api.github.com/repos/anuchandy/azure-sdk-for-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/anuchandy/azure-sdk-for-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/anuchandy/azure-sdk-for-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/anuchandy/azure-sdk-for-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/anuchandy/azure-sdk-for-java/contents/{+path}","compare_url":"https://api.github.com/repos/anuchandy/azure-sdk-for-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/anuchandy/azure-sdk-for-java/merges","archive_url":"https://api.github.com/repos/anuchandy/azure-sdk-for-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/anuchandy/azure-sdk-for-java/downloads","issues_url":"https://api.github.com/repos/anuchandy/azure-sdk-for-java/issues{/number}","pulls_url":"https://api.github.com/repos/anuchandy/azure-sdk-for-java/pulls{/number}","milestones_url":"https://api.github.com/repos/anuchandy/azure-sdk-for-java/milestones{/number}","notifications_url":"https://api.github.com/repos/anuchandy/azure-sdk-for-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/anuchandy/azure-sdk-for-java/labels{/name}","releases_url":"https://api.github.com/repos/anuchandy/azure-sdk-for-java/releases{/id}","deployments_url":"https://api.github.com/repos/anuchandy/azure-sdk-for-java/deployments","created_at":"2016-05-05T00:14:46Z","updated_at":"2016-05-05T00:14:50Z","pushed_at":"2016-06-07T05:07:40Z","git_url":"git://github.com/anuchandy/azure-sdk-for-java.git","ssh_url":"git@github.com:anuchandy/azure-sdk-for-java.git","clone_url":"https://github.com/anuchandy/azure-sdk-for-java.git","svn_url":"https://github.com/anuchandy/azure-sdk-for-java","homepage":"http://azure.microsoft.com/en-us/develop/java/","size":30373,"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":"Azure:master","ref":"master","sha":"6e5147c6c886846d6415b7b303c8181ac0170c9d","user":{"login":"Azure","id":6844498,"avatar_url":"https://avatars.githubusercontent.com/u/6844498?v=3","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"repo":{"id":2928948,"name":"azure-sdk-for-java","full_name":"Azure/azure-sdk-for-java","owner":{"login":"Azure","id":6844498,"avatar_url":"https://avatars.githubusercontent.com/u/6844498?v=3","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Azure/azure-sdk-for-java","description":"Microsoft Azure SDK for Java","fork":false,"url":"https://api.github.com/repos/Azure/azure-sdk-for-java","forks_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/forks","keys_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/teams","hooks_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/hooks","issue_events_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/issues/events{/number}","events_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/events","assignees_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/assignees{/user}","branches_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/branches{/branch}","tags_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/tags","blobs_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/statuses/{sha}","languages_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/languages","stargazers_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/stargazers","contributors_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/contributors","subscribers_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/subscribers","subscription_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/subscription","commits_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/contents/{+path}","compare_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/merges","archive_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/downloads","issues_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/issues{/number}","pulls_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/pulls{/number}","milestones_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/milestones{/number}","notifications_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/labels{/name}","releases_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/releases{/id}","deployments_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/deployments","created_at":"2011-12-06T23:33:56Z","updated_at":"2016-06-06T17:40:22Z","pushed_at":"2016-06-07T05:07:41Z","git_url":"git://github.com/Azure/azure-sdk-for-java.git","ssh_url":"git@github.com:Azure/azure-sdk-for-java.git","clone_url":"https://github.com/Azure/azure-sdk-for-java.git","svn_url":"https://github.com/Azure/azure-sdk-for-java","homepage":"http://azure.microsoft.com/en-us/develop/java/","size":40022,"stargazers_count":233,"watchers_count":233,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":192,"mirror_url":null,"open_issues_count":93,"forks":192,"open_issues":93,"watchers":233,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-sdk-for-java/pulls/770"},"html":{"href":"https://github.com/Azure/azure-sdk-for-java/pull/770"},"issue":{"href":"https://api.github.com/repos/Azure/azure-sdk-for-java/issues/770"},"comments":{"href":"https://api.github.com/repos/Azure/azure-sdk-for-java/issues/770/comments"},"review_comments":{"href":"https://api.github.com/repos/Azure/azure-sdk-for-java/pulls/770/comments"},"review_comment":{"href":"https://api.github.com/repos/Azure/azure-sdk-for-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Azure/azure-sdk-for-java/pulls/770/commits"},"statuses":{"href":"https://api.github.com/repos/Azure/azure-sdk-for-java/statuses/2f39e4bcb49a406dd8e4b37ca308b18ca9d11cda"}}}}
{"actor":{"display_login":"jianghaolu"}}