{"action":"created","comment":{"url":"https://api.github.com/repos/6fusion/vmware-collector/pulls/comments/62865042","id":62865042,"diff_hunk":"@@ -602,55 +575,43 @@ def add_machine_nics_prids(machine)\n     end\n   end\n \n-  def load_infrastructure_data\n-    all_infrastructure_json = @hyper_client.get_all_resources(infrastructures_url)\n-\n-    all_infrastructure_json.each do |json_batch|\n-      infrastructures = json_batch['embedded']['infrastructures']\n-      infrastructures.each do |inf|\n-        @local_infrastructure_inventory[inf['name']] = Infrastructure.new(name: inf['name'])\n-      end\n-    end\n-    @local_infrastructure_inventory.save\n-  end\n-\n   def retrieve_machines(infrastructure)\n     machines_by_platform_id = Hash.new\n-\n-    machines_json = @hyper_client.get_all_resources(infrastructure_machines_url(infrastructure.remote_id), {fields: 'remote_id'})\n+    machines_json = @hyper_client.get_all_resources(infrastructure_machines_url(infrastructure_id: infrastructure.remote_id))\n     machines_json.each do |json|\n-      remote_id = json['remote_id']\n-      response = @hyper_client.get(infrastructure_machine_url(infrastructure.remote_id, remote_id) + \".json\", {expand: 'disks,nics'})\n+      remote_id = json['id']\n+      response = @hyper_client.get(retrieve_machine(remote_id))\n       if ( response.code == 200 )\n-        machine_json = response.json\n-        machine = Machine.new(remote_id:     machine_json['remote_id'],\n+        machine_json = JSON.parse(response)\n+        logger.debug \"\\n\\n\\n MACHINE JSON = > #{machine_json}\\n\\n\\n\\n\\n\"\n+        machine = Machine.new(remote_id:     machine_json['id'],\n                               name:          machine_json['name'],\n-                              virtual_name:  machine_json['virtual_name'],\n+                              virtual_name:  machine_json['custom_id'], #CHECK THIS AS IN ON PREM THERE IS NO VIRTUAL NAME","path":"lib/uc6_connector.rb","position":206,"original_position":206,"commit_id":"d90c2eb47f50740d8e744b1a288107301c041f41","original_commit_id":"d90c2eb47f50740d8e744b1a288107301c041f41","user":{"login":"rrodriguez-gap","id":1437948,"avatar_url":"https://avatars.githubusercontent.com/u/1437948?v=3","gravatar_id":"","url":"https://api.github.com/users/rrodriguez-gap","html_url":"https://github.com/rrodriguez-gap","followers_url":"https://api.github.com/users/rrodriguez-gap/followers","following_url":"https://api.github.com/users/rrodriguez-gap/following{/other_user}","gists_url":"https://api.github.com/users/rrodriguez-gap/gists{/gist_id}","starred_url":"https://api.github.com/users/rrodriguez-gap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rrodriguez-gap/subscriptions","organizations_url":"https://api.github.com/users/rrodriguez-gap/orgs","repos_url":"https://api.github.com/users/rrodriguez-gap/repos","events_url":"https://api.github.com/users/rrodriguez-gap/events{/privacy}","received_events_url":"https://api.github.com/users/rrodriguez-gap/received_events","type":"User","site_admin":false},"body":"Maybe you could remove this comment as it may not be required anymore.","created_at":"2016-05-11T15:03:44Z","updated_at":"2016-05-11T15:03:44Z","html_url":"https://github.com/6fusion/vmware-collector/pull/6#discussion_r62865042","pull_request_url":"https://api.github.com/repos/6fusion/vmware-collector/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/6fusion/vmware-collector/pulls/comments/62865042"},"html":{"href":"https://github.com/6fusion/vmware-collector/pull/6#discussion_r62865042"},"pull_request":{"href":"https://api.github.com/repos/6fusion/vmware-collector/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/6fusion/vmware-collector/pulls/6","id":69673128,"html_url":"https://github.com/6fusion/vmware-collector/pull/6","diff_url":"https://github.com/6fusion/vmware-collector/pull/6.diff","patch_url":"https://github.com/6fusion/vmware-collector/pull/6.patch","issue_url":"https://api.github.com/repos/6fusion/vmware-collector/issues/6","number":6,"state":"open","locked":false,"title":"Use custom_id field as there is not a virtual_name field","user":{"login":"fernandacoto","id":4039322,"avatar_url":"https://avatars.githubusercontent.com/u/4039322?v=3","gravatar_id":"","url":"https://api.github.com/users/fernandacoto","html_url":"https://github.com/fernandacoto","followers_url":"https://api.github.com/users/fernandacoto/followers","following_url":"https://api.github.com/users/fernandacoto/following{/other_user}","gists_url":"https://api.github.com/users/fernandacoto/gists{/gist_id}","starred_url":"https://api.github.com/users/fernandacoto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fernandacoto/subscriptions","organizations_url":"https://api.github.com/users/fernandacoto/orgs","repos_url":"https://api.github.com/users/fernandacoto/repos","events_url":"https://api.github.com/users/fernandacoto/events{/privacy}","received_events_url":"https://api.github.com/users/fernandacoto/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-05-11T13:37:16Z","updated_at":"2016-05-11T15:03:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"742e77be92e4d513eaa6150e77f5634d0bb31664","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/6fusion/vmware-collector/pulls/6/commits","review_comments_url":"https://api.github.com/repos/6fusion/vmware-collector/pulls/6/comments","review_comment_url":"https://api.github.com/repos/6fusion/vmware-collector/pulls/comments{/number}","comments_url":"https://api.github.com/repos/6fusion/vmware-collector/issues/6/comments","statuses_url":"https://api.github.com/repos/6fusion/vmware-collector/statuses/d90c2eb47f50740d8e744b1a288107301c041f41","head":{"label":"6fusion:US522","ref":"US522","sha":"d90c2eb47f50740d8e744b1a288107301c041f41","user":{"login":"6fusion","id":1864001,"avatar_url":"https://avatars.githubusercontent.com/u/1864001?v=3","gravatar_id":"","url":"https://api.github.com/users/6fusion","html_url":"https://github.com/6fusion","followers_url":"https://api.github.com/users/6fusion/followers","following_url":"https://api.github.com/users/6fusion/following{/other_user}","gists_url":"https://api.github.com/users/6fusion/gists{/gist_id}","starred_url":"https://api.github.com/users/6fusion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/6fusion/subscriptions","organizations_url":"https://api.github.com/users/6fusion/orgs","repos_url":"https://api.github.com/users/6fusion/repos","events_url":"https://api.github.com/users/6fusion/events{/privacy}","received_events_url":"https://api.github.com/users/6fusion/received_events","type":"Organization","site_admin":false},"repo":{"id":55718118,"name":"vmware-collector","full_name":"6fusion/vmware-collector","owner":{"login":"6fusion","id":1864001,"avatar_url":"https://avatars.githubusercontent.com/u/1864001?v=3","gravatar_id":"","url":"https://api.github.com/users/6fusion","html_url":"https://github.com/6fusion","followers_url":"https://api.github.com/users/6fusion/followers","following_url":"https://api.github.com/users/6fusion/following{/other_user}","gists_url":"https://api.github.com/users/6fusion/gists{/gist_id}","starred_url":"https://api.github.com/users/6fusion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/6fusion/subscriptions","organizations_url":"https://api.github.com/users/6fusion/orgs","repos_url":"https://api.github.com/users/6fusion/repos","events_url":"https://api.github.com/users/6fusion/events{/privacy}","received_events_url":"https://api.github.com/users/6fusion/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/6fusion/vmware-collector","description":"","fork":false,"url":"https://api.github.com/repos/6fusion/vmware-collector","forks_url":"https://api.github.com/repos/6fusion/vmware-collector/forks","keys_url":"https://api.github.com/repos/6fusion/vmware-collector/keys{/key_id}","collaborators_url":"https://api.github.com/repos/6fusion/vmware-collector/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/6fusion/vmware-collector/teams","hooks_url":"https://api.github.com/repos/6fusion/vmware-collector/hooks","issue_events_url":"https://api.github.com/repos/6fusion/vmware-collector/issues/events{/number}","events_url":"https://api.github.com/repos/6fusion/vmware-collector/events","assignees_url":"https://api.github.com/repos/6fusion/vmware-collector/assignees{/user}","branches_url":"https://api.github.com/repos/6fusion/vmware-collector/branches{/branch}","tags_url":"https://api.github.com/repos/6fusion/vmware-collector/tags","blobs_url":"https://api.github.com/repos/6fusion/vmware-collector/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/6fusion/vmware-collector/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/6fusion/vmware-collector/git/refs{/sha}","trees_url":"https://api.github.com/repos/6fusion/vmware-collector/git/trees{/sha}","statuses_url":"https://api.github.com/repos/6fusion/vmware-collector/statuses/{sha}","languages_url":"https://api.github.com/repos/6fusion/vmware-collector/languages","stargazers_url":"https://api.github.com/repos/6fusion/vmware-collector/stargazers","contributors_url":"https://api.github.com/repos/6fusion/vmware-collector/contributors","subscribers_url":"https://api.github.com/repos/6fusion/vmware-collector/subscribers","subscription_url":"https://api.github.com/repos/6fusion/vmware-collector/subscription","commits_url":"https://api.github.com/repos/6fusion/vmware-collector/commits{/sha}","git_commits_url":"https://api.github.com/repos/6fusion/vmware-collector/git/commits{/sha}","comments_url":"https://api.github.com/repos/6fusion/vmware-collector/comments{/number}","issue_comment_url":"https://api.github.com/repos/6fusion/vmware-collector/issues/comments{/number}","contents_url":"https://api.github.com/repos/6fusion/vmware-collector/contents/{+path}","compare_url":"https://api.github.com/repos/6fusion/vmware-collector/compare/{base}...{head}","merges_url":"https://api.github.com/repos/6fusion/vmware-collector/merges","archive_url":"https://api.github.com/repos/6fusion/vmware-collector/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/6fusion/vmware-collector/downloads","issues_url":"https://api.github.com/repos/6fusion/vmware-collector/issues{/number}","pulls_url":"https://api.github.com/repos/6fusion/vmware-collector/pulls{/number}","milestones_url":"https://api.github.com/repos/6fusion/vmware-collector/milestones{/number}","notifications_url":"https://api.github.com/repos/6fusion/vmware-collector/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/6fusion/vmware-collector/labels{/name}","releases_url":"https://api.github.com/repos/6fusion/vmware-collector/releases{/id}","deployments_url":"https://api.github.com/repos/6fusion/vmware-collector/deployments","created_at":"2016-04-07T18:26:48Z","updated_at":"2016-04-18T14:28:49Z","pushed_at":"2016-05-11T14:04:43Z","git_url":"git://github.com/6fusion/vmware-collector.git","ssh_url":"git@github.com:6fusion/vmware-collector.git","clone_url":"https://github.com/6fusion/vmware-collector.git","svn_url":"https://github.com/6fusion/vmware-collector","homepage":null,"size":391,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"base":{"label":"6fusion:develop","ref":"develop","sha":"3e9c83f649b614c670317bfe9991339e73353cb8","user":{"login":"6fusion","id":1864001,"avatar_url":"https://avatars.githubusercontent.com/u/1864001?v=3","gravatar_id":"","url":"https://api.github.com/users/6fusion","html_url":"https://github.com/6fusion","followers_url":"https://api.github.com/users/6fusion/followers","following_url":"https://api.github.com/users/6fusion/following{/other_user}","gists_url":"https://api.github.com/users/6fusion/gists{/gist_id}","starred_url":"https://api.github.com/users/6fusion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/6fusion/subscriptions","organizations_url":"https://api.github.com/users/6fusion/orgs","repos_url":"https://api.github.com/users/6fusion/repos","events_url":"https://api.github.com/users/6fusion/events{/privacy}","received_events_url":"https://api.github.com/users/6fusion/received_events","type":"Organization","site_admin":false},"repo":{"id":55718118,"name":"vmware-collector","full_name":"6fusion/vmware-collector","owner":{"login":"6fusion","id":1864001,"avatar_url":"https://avatars.githubusercontent.com/u/1864001?v=3","gravatar_id":"","url":"https://api.github.com/users/6fusion","html_url":"https://github.com/6fusion","followers_url":"https://api.github.com/users/6fusion/followers","following_url":"https://api.github.com/users/6fusion/following{/other_user}","gists_url":"https://api.github.com/users/6fusion/gists{/gist_id}","starred_url":"https://api.github.com/users/6fusion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/6fusion/subscriptions","organizations_url":"https://api.github.com/users/6fusion/orgs","repos_url":"https://api.github.com/users/6fusion/repos","events_url":"https://api.github.com/users/6fusion/events{/privacy}","received_events_url":"https://api.github.com/users/6fusion/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/6fusion/vmware-collector","description":"","fork":false,"url":"https://api.github.com/repos/6fusion/vmware-collector","forks_url":"https://api.github.com/repos/6fusion/vmware-collector/forks","keys_url":"https://api.github.com/repos/6fusion/vmware-collector/keys{/key_id}","collaborators_url":"https://api.github.com/repos/6fusion/vmware-collector/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/6fusion/vmware-collector/teams","hooks_url":"https://api.github.com/repos/6fusion/vmware-collector/hooks","issue_events_url":"https://api.github.com/repos/6fusion/vmware-collector/issues/events{/number}","events_url":"https://api.github.com/repos/6fusion/vmware-collector/events","assignees_url":"https://api.github.com/repos/6fusion/vmware-collector/assignees{/user}","branches_url":"https://api.github.com/repos/6fusion/vmware-collector/branches{/branch}","tags_url":"https://api.github.com/repos/6fusion/vmware-collector/tags","blobs_url":"https://api.github.com/repos/6fusion/vmware-collector/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/6fusion/vmware-collector/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/6fusion/vmware-collector/git/refs{/sha}","trees_url":"https://api.github.com/repos/6fusion/vmware-collector/git/trees{/sha}","statuses_url":"https://api.github.com/repos/6fusion/vmware-collector/statuses/{sha}","languages_url":"https://api.github.com/repos/6fusion/vmware-collector/languages","stargazers_url":"https://api.github.com/repos/6fusion/vmware-collector/stargazers","contributors_url":"https://api.github.com/repos/6fusion/vmware-collector/contributors","subscribers_url":"https://api.github.com/repos/6fusion/vmware-collector/subscribers","subscription_url":"https://api.github.com/repos/6fusion/vmware-collector/subscription","commits_url":"https://api.github.com/repos/6fusion/vmware-collector/commits{/sha}","git_commits_url":"https://api.github.com/repos/6fusion/vmware-collector/git/commits{/sha}","comments_url":"https://api.github.com/repos/6fusion/vmware-collector/comments{/number}","issue_comment_url":"https://api.github.com/repos/6fusion/vmware-collector/issues/comments{/number}","contents_url":"https://api.github.com/repos/6fusion/vmware-collector/contents/{+path}","compare_url":"https://api.github.com/repos/6fusion/vmware-collector/compare/{base}...{head}","merges_url":"https://api.github.com/repos/6fusion/vmware-collector/merges","archive_url":"https://api.github.com/repos/6fusion/vmware-collector/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/6fusion/vmware-collector/downloads","issues_url":"https://api.github.com/repos/6fusion/vmware-collector/issues{/number}","pulls_url":"https://api.github.com/repos/6fusion/vmware-collector/pulls{/number}","milestones_url":"https://api.github.com/repos/6fusion/vmware-collector/milestones{/number}","notifications_url":"https://api.github.com/repos/6fusion/vmware-collector/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/6fusion/vmware-collector/labels{/name}","releases_url":"https://api.github.com/repos/6fusion/vmware-collector/releases{/id}","deployments_url":"https://api.github.com/repos/6fusion/vmware-collector/deployments","created_at":"2016-04-07T18:26:48Z","updated_at":"2016-04-18T14:28:49Z","pushed_at":"2016-05-11T14:04:43Z","git_url":"git://github.com/6fusion/vmware-collector.git","ssh_url":"git@github.com:6fusion/vmware-collector.git","clone_url":"https://github.com/6fusion/vmware-collector.git","svn_url":"https://github.com/6fusion/vmware-collector","homepage":null,"size":391,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/6fusion/vmware-collector/pulls/6"},"html":{"href":"https://github.com/6fusion/vmware-collector/pull/6"},"issue":{"href":"https://api.github.com/repos/6fusion/vmware-collector/issues/6"},"comments":{"href":"https://api.github.com/repos/6fusion/vmware-collector/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/6fusion/vmware-collector/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/6fusion/vmware-collector/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/6fusion/vmware-collector/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/6fusion/vmware-collector/statuses/d90c2eb47f50740d8e744b1a288107301c041f41"}}}}