{"action":"created","comment":{"url":"https://api.github.com/repos/dcos/dcos-ui/pulls/comments/254226589","pull_request_review_id":200519579,"id":254226589,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI1NDIyNjU4OQ==","diff_hunk":"@@ -0,0 +1,32 @@\n+import { Observable } from \"rxjs\";\n+import { request, RequestResponse } from \"@dcos/http-service\";\n+import { map } from \"rxjs/operators\";\n+\n+export interface NetworkNode {\n+  updated: string;\n+  public_ips: string[];\n+  private_ip: string;\n+  hostname: string;\n+}\n+\n+export type NetworkNodesResponse = NetworkNode[];\n+\n+export function fetchNetworkNodes(): Observable<RequestResponse<string[]>> {\n+  return request(\"/net/v1/nodes\").pipe(\n+    map((reqResp: RequestResponse<any>) => {\n+      if (reqResp.code >= 300) {","path":"plugins/nodes/src/js/data/NetworkNodesClient.ts","position":17,"original_position":17,"commit_id":"5394ed0dff622679fbd96f78bf46a11f87b2fdf3","original_commit_id":"765cabe5d74c3523d0ff6233427774313c457cce","user":{"login":"nLight","id":186223,"node_id":"MDQ6VXNlcjE4NjIyMw==","avatar_url":"https://avatars0.githubusercontent.com/u/186223?v=4","gravatar_id":"","url":"https://api.github.com/users/nLight","html_url":"https://github.com/nLight","followers_url":"https://api.github.com/users/nLight/followers","following_url":"https://api.github.com/users/nLight/following{/other_user}","gists_url":"https://api.github.com/users/nLight/gists{/gist_id}","starred_url":"https://api.github.com/users/nLight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nLight/subscriptions","organizations_url":"https://api.github.com/users/nLight/orgs","repos_url":"https://api.github.com/users/nLight/repos","events_url":"https://api.github.com/users/nLight/events{/privacy}","received_events_url":"https://api.github.com/users/nLight/received_events","type":"User","site_admin":false},"body":"Currently we're misusing map as we don't really map anything we just use it to filter errors and throw a side effect. I believe the upside of clear separation of intent is superior over a bit of extra performance.","created_at":"2019-02-06T11:07:35Z","updated_at":"2019-02-06T11:07:35Z","html_url":"https://github.com/dcos/dcos-ui/pull/3579#discussion_r254226589","pull_request_url":"https://api.github.com/repos/dcos/dcos-ui/pulls/3579","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/dcos/dcos-ui/pulls/comments/254226589"},"html":{"href":"https://github.com/dcos/dcos-ui/pull/3579#discussion_r254226589"},"pull_request":{"href":"https://api.github.com/repos/dcos/dcos-ui/pulls/3579"}},"in_reply_to_id":253820308},"pull_request":{"url":"https://api.github.com/repos/dcos/dcos-ui/pulls/3579","id":250330818,"node_id":"MDExOlB1bGxSZXF1ZXN0MjUwMzMwODE4","html_url":"https://github.com/dcos/dcos-ui/pull/3579","diff_url":"https://github.com/dcos/dcos-ui/pull/3579.diff","patch_url":"https://github.com/dcos/dcos-ui/pull/3579.patch","issue_url":"https://api.github.com/repos/dcos/dcos-ui/issues/3579","number":3579,"state":"open","locked":false,"title":"DCOS-44840: feature public ip add network nodes endpoint client","user":{"login":"Poltergeist","id":156010,"node_id":"MDQ6VXNlcjE1NjAxMA==","avatar_url":"https://avatars0.githubusercontent.com/u/156010?v=4","gravatar_id":"","url":"https://api.github.com/users/Poltergeist","html_url":"https://github.com/Poltergeist","followers_url":"https://api.github.com/users/Poltergeist/followers","following_url":"https://api.github.com/users/Poltergeist/following{/other_user}","gists_url":"https://api.github.com/users/Poltergeist/gists{/gist_id}","starred_url":"https://api.github.com/users/Poltergeist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Poltergeist/subscriptions","organizations_url":"https://api.github.com/users/Poltergeist/orgs","repos_url":"https://api.github.com/users/Poltergeist/repos","events_url":"https://api.github.com/users/Poltergeist/events{/privacy}","received_events_url":"https://api.github.com/users/Poltergeist/received_events","type":"User","site_admin":false},"body":"This adds a http client which connects to the `/net/v1/nodes` endpoint and is returning a observable\r\n\r\nCloses DCOS-44840\r\n\r\n## Testing\r\n\r\nYou can test it by running the test and sanity check the code. Also you could do the following changes\r\n```diff\r\ndiff --git a/plugins/nodes/src/js/components/NodesTable.tsx b/plugins/nodes/src/js/components/NodesTable.tsx\r\nindex 867ca1b3d..6b7aedbe9 100644\r\n--- a/plugins/nodes/src/js/components/NodesTable.tsx\r\n+++ b/plugins/nodes/src/js/components/NodesTable.tsx\r\n@@ -29,6 +29,10 @@ import {\r\n   spacingRenderer\r\n } from \"../columns/NodesTableSpacingColumn\";\r\n \r\n+import * as NetworkNodesClient from \"../data/NetworkNodesClient\";\r\n+\r\n+console.log(NetworkNodesClient);\r\n+\r\n interface NodesTableProps {\r\n   hosts: NodesList;\r\n   nodeHealthResponse: boolean;\r\ndiff --git a/plugins/nodes/src/js/data/NetworkNodesClient.ts b/plugins/nodes/src/js/data/NetworkNodesClient.ts\r\nindex c5f8f87e0..848b95f95 100644\r\n--- a/plugins/nodes/src/js/data/NetworkNodesClient.ts\r\n+++ b/plugins/nodes/src/js/data/NetworkNodesClient.ts\r\n@@ -30,3 +30,5 @@ export function fetchNetworkNodes(): Observable<RequestResponse<string[]>> {\r\n     })\r\n   );\r\n }\r\n+\r\n+window.test = fetchNetworkNodes;\r\n\r\n```\r\n\r\nAlternatively you can run the following command `curl https://gist.githubusercontent.com/Poltergeist/c11cc88857748e91c317eea536a1903a/raw/ebc585ed08fa4f804c640ff1025d1bca73be7f5f/dcos-44840-test.diff | git apply`\r\n\r\nAnd run `window.test().subscribe(a=>console.log(a))` from the console in your browser this should give you the response from the `/net/v1/nodes` endpoint.\r\n\r\n## Trade-offs\r\n\r\nN/A\r\n\r\n## Dependencies\r\n\r\nN/A\r\n\r\n## Screenshots\r\n\r\nN/A","created_at":"2019-02-05T09:24:40Z","updated_at":"2019-02-06T11:07:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ca2f4d4de82980dd7910dc406a2ce01702d40053","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/dcos/dcos-ui/pulls/3579/commits","review_comments_url":"https://api.github.com/repos/dcos/dcos-ui/pulls/3579/comments","review_comment_url":"https://api.github.com/repos/dcos/dcos-ui/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dcos/dcos-ui/issues/3579/comments","statuses_url":"https://api.github.com/repos/dcos/dcos-ui/statuses/5394ed0dff622679fbd96f78bf46a11f87b2fdf3","head":{"label":"dcos:ph/feature/DCOS-44840-network-nodes-client","ref":"ph/feature/DCOS-44840-network-nodes-client","sha":"5394ed0dff622679fbd96f78bf46a11f87b2fdf3","user":{"login":"dcos","id":17648048,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3NjQ4MDQ4","avatar_url":"https://avatars1.githubusercontent.com/u/17648048?v=4","gravatar_id":"","url":"https://api.github.com/users/dcos","html_url":"https://github.com/dcos","followers_url":"https://api.github.com/users/dcos/followers","following_url":"https://api.github.com/users/dcos/following{/other_user}","gists_url":"https://api.github.com/users/dcos/gists{/gist_id}","starred_url":"https://api.github.com/users/dcos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcos/subscriptions","organizations_url":"https://api.github.com/users/dcos/orgs","repos_url":"https://api.github.com/users/dcos/repos","events_url":"https://api.github.com/users/dcos/events{/privacy}","received_events_url":"https://api.github.com/users/dcos/received_events","type":"Organization","site_admin":false},"repo":{"id":56547504,"node_id":"MDEwOlJlcG9zaXRvcnk1NjU0NzUwNA==","name":"dcos-ui","full_name":"dcos/dcos-ui","private":false,"owner":{"login":"dcos","id":17648048,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3NjQ4MDQ4","avatar_url":"https://avatars1.githubusercontent.com/u/17648048?v=4","gravatar_id":"","url":"https://api.github.com/users/dcos","html_url":"https://github.com/dcos","followers_url":"https://api.github.com/users/dcos/followers","following_url":"https://api.github.com/users/dcos/following{/other_user}","gists_url":"https://api.github.com/users/dcos/gists{/gist_id}","starred_url":"https://api.github.com/users/dcos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcos/subscriptions","organizations_url":"https://api.github.com/users/dcos/orgs","repos_url":"https://api.github.com/users/dcos/repos","events_url":"https://api.github.com/users/dcos/events{/privacy}","received_events_url":"https://api.github.com/users/dcos/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/dcos/dcos-ui","description":"The UI for The Datacenter Operating System","fork":false,"url":"https://api.github.com/repos/dcos/dcos-ui","forks_url":"https://api.github.com/repos/dcos/dcos-ui/forks","keys_url":"https://api.github.com/repos/dcos/dcos-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dcos/dcos-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dcos/dcos-ui/teams","hooks_url":"https://api.github.com/repos/dcos/dcos-ui/hooks","issue_events_url":"https://api.github.com/repos/dcos/dcos-ui/issues/events{/number}","events_url":"https://api.github.com/repos/dcos/dcos-ui/events","assignees_url":"https://api.github.com/repos/dcos/dcos-ui/assignees{/user}","branches_url":"https://api.github.com/repos/dcos/dcos-ui/branches{/branch}","tags_url":"https://api.github.com/repos/dcos/dcos-ui/tags","blobs_url":"https://api.github.com/repos/dcos/dcos-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dcos/dcos-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dcos/dcos-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/dcos/dcos-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dcos/dcos-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/dcos/dcos-ui/languages","stargazers_url":"https://api.github.com/repos/dcos/dcos-ui/stargazers","contributors_url":"https://api.github.com/repos/dcos/dcos-ui/contributors","subscribers_url":"https://api.github.com/repos/dcos/dcos-ui/subscribers","subscription_url":"https://api.github.com/repos/dcos/dcos-ui/subscription","commits_url":"https://api.github.com/repos/dcos/dcos-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/dcos/dcos-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/dcos/dcos-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/dcos/dcos-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/dcos/dcos-ui/contents/{+path}","compare_url":"https://api.github.com/repos/dcos/dcos-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dcos/dcos-ui/merges","archive_url":"https://api.github.com/repos/dcos/dcos-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dcos/dcos-ui/downloads","issues_url":"https://api.github.com/repos/dcos/dcos-ui/issues{/number}","pulls_url":"https://api.github.com/repos/dcos/dcos-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/dcos/dcos-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/dcos/dcos-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dcos/dcos-ui/labels{/name}","releases_url":"https://api.github.com/repos/dcos/dcos-ui/releases{/id}","deployments_url":"https://api.github.com/repos/dcos/dcos-ui/deployments","created_at":"2016-04-18T22:48:06Z","updated_at":"2019-02-06T09:17:44Z","pushed_at":"2019-02-06T10:47:42Z","git_url":"git://github.com/dcos/dcos-ui.git","ssh_url":"git@github.com:dcos/dcos-ui.git","clone_url":"https://github.com/dcos/dcos-ui.git","svn_url":"https://github.com/dcos/dcos-ui","homepage":"https://dcos.io/","size":49594,"stargazers_count":198,"watchers_count":198,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":80,"mirror_url":null,"archived":false,"open_issues_count":24,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":80,"open_issues":24,"watchers":198,"default_branch":"master"}},"base":{"label":"dcos:master","ref":"master","sha":"4ba8e4dd9a9232bc723b896bdce041fb2210fc2b","user":{"login":"dcos","id":17648048,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3NjQ4MDQ4","avatar_url":"https://avatars1.githubusercontent.com/u/17648048?v=4","gravatar_id":"","url":"https://api.github.com/users/dcos","html_url":"https://github.com/dcos","followers_url":"https://api.github.com/users/dcos/followers","following_url":"https://api.github.com/users/dcos/following{/other_user}","gists_url":"https://api.github.com/users/dcos/gists{/gist_id}","starred_url":"https://api.github.com/users/dcos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcos/subscriptions","organizations_url":"https://api.github.com/users/dcos/orgs","repos_url":"https://api.github.com/users/dcos/repos","events_url":"https://api.github.com/users/dcos/events{/privacy}","received_events_url":"https://api.github.com/users/dcos/received_events","type":"Organization","site_admin":false},"repo":{"id":56547504,"node_id":"MDEwOlJlcG9zaXRvcnk1NjU0NzUwNA==","name":"dcos-ui","full_name":"dcos/dcos-ui","private":false,"owner":{"login":"dcos","id":17648048,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3NjQ4MDQ4","avatar_url":"https://avatars1.githubusercontent.com/u/17648048?v=4","gravatar_id":"","url":"https://api.github.com/users/dcos","html_url":"https://github.com/dcos","followers_url":"https://api.github.com/users/dcos/followers","following_url":"https://api.github.com/users/dcos/following{/other_user}","gists_url":"https://api.github.com/users/dcos/gists{/gist_id}","starred_url":"https://api.github.com/users/dcos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcos/subscriptions","organizations_url":"https://api.github.com/users/dcos/orgs","repos_url":"https://api.github.com/users/dcos/repos","events_url":"https://api.github.com/users/dcos/events{/privacy}","received_events_url":"https://api.github.com/users/dcos/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/dcos/dcos-ui","description":"The UI for The Datacenter Operating System","fork":false,"url":"https://api.github.com/repos/dcos/dcos-ui","forks_url":"https://api.github.com/repos/dcos/dcos-ui/forks","keys_url":"https://api.github.com/repos/dcos/dcos-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dcos/dcos-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dcos/dcos-ui/teams","hooks_url":"https://api.github.com/repos/dcos/dcos-ui/hooks","issue_events_url":"https://api.github.com/repos/dcos/dcos-ui/issues/events{/number}","events_url":"https://api.github.com/repos/dcos/dcos-ui/events","assignees_url":"https://api.github.com/repos/dcos/dcos-ui/assignees{/user}","branches_url":"https://api.github.com/repos/dcos/dcos-ui/branches{/branch}","tags_url":"https://api.github.com/repos/dcos/dcos-ui/tags","blobs_url":"https://api.github.com/repos/dcos/dcos-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dcos/dcos-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dcos/dcos-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/dcos/dcos-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dcos/dcos-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/dcos/dcos-ui/languages","stargazers_url":"https://api.github.com/repos/dcos/dcos-ui/stargazers","contributors_url":"https://api.github.com/repos/dcos/dcos-ui/contributors","subscribers_url":"https://api.github.com/repos/dcos/dcos-ui/subscribers","subscription_url":"https://api.github.com/repos/dcos/dcos-ui/subscription","commits_url":"https://api.github.com/repos/dcos/dcos-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/dcos/dcos-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/dcos/dcos-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/dcos/dcos-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/dcos/dcos-ui/contents/{+path}","compare_url":"https://api.github.com/repos/dcos/dcos-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dcos/dcos-ui/merges","archive_url":"https://api.github.com/repos/dcos/dcos-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dcos/dcos-ui/downloads","issues_url":"https://api.github.com/repos/dcos/dcos-ui/issues{/number}","pulls_url":"https://api.github.com/repos/dcos/dcos-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/dcos/dcos-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/dcos/dcos-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dcos/dcos-ui/labels{/name}","releases_url":"https://api.github.com/repos/dcos/dcos-ui/releases{/id}","deployments_url":"https://api.github.com/repos/dcos/dcos-ui/deployments","created_at":"2016-04-18T22:48:06Z","updated_at":"2019-02-06T09:17:44Z","pushed_at":"2019-02-06T10:47:42Z","git_url":"git://github.com/dcos/dcos-ui.git","ssh_url":"git@github.com:dcos/dcos-ui.git","clone_url":"https://github.com/dcos/dcos-ui.git","svn_url":"https://github.com/dcos/dcos-ui","homepage":"https://dcos.io/","size":49594,"stargazers_count":198,"watchers_count":198,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":80,"mirror_url":null,"archived":false,"open_issues_count":24,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":80,"open_issues":24,"watchers":198,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dcos/dcos-ui/pulls/3579"},"html":{"href":"https://github.com/dcos/dcos-ui/pull/3579"},"issue":{"href":"https://api.github.com/repos/dcos/dcos-ui/issues/3579"},"comments":{"href":"https://api.github.com/repos/dcos/dcos-ui/issues/3579/comments"},"review_comments":{"href":"https://api.github.com/repos/dcos/dcos-ui/pulls/3579/comments"},"review_comment":{"href":"https://api.github.com/repos/dcos/dcos-ui/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dcos/dcos-ui/pulls/3579/commits"},"statuses":{"href":"https://api.github.com/repos/dcos/dcos-ui/statuses/5394ed0dff622679fbd96f78bf46a11f87b2fdf3"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"nLight"}}