{"action":"created","comment":{"url":"https://api.github.com/repos/openshift/origin/pulls/comments/47796759","id":47796759,"diff_hunk":"@@ -6,6 +6,7 @@ angular.module(\"openshiftConsole\")\n       $q,\n       $routeParams,\n       DataService,\n+      ApiEndpointService,","path":"assets/app/scripts/controllers/create/createFromImage.js","position":4,"original_position":4,"commit_id":"c7ecc67ab4e6cdf7ff701d847f541b9a1836f8bd","original_commit_id":"c7ecc67ab4e6cdf7ff701d847f541b9a1836f8bd","user":{"login":"benjaminapetersen","id":280512,"avatar_url":"https://avatars.githubusercontent.com/u/280512?v=3","gravatar_id":"","url":"https://api.github.com/users/benjaminapetersen","html_url":"https://github.com/benjaminapetersen","followers_url":"https://api.github.com/users/benjaminapetersen/followers","following_url":"https://api.github.com/users/benjaminapetersen/following{/other_user}","gists_url":"https://api.github.com/users/benjaminapetersen/gists{/gist_id}","starred_url":"https://api.github.com/users/benjaminapetersen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjaminapetersen/subscriptions","organizations_url":"https://api.github.com/users/benjaminapetersen/orgs","repos_url":"https://api.github.com/users/benjaminapetersen/repos","events_url":"https://api.github.com/users/benjaminapetersen/events{/privacy}","received_events_url":"https://api.github.com/users/benjaminapetersen/received_events","type":"User","site_admin":false},"body":"I even prefer leaving out the word 'Service' , except that we have it everywhere.  'Controller' in controllers is fine because they are never requested via DI, but we could trim these all down at some point:\r\n```javascript\r\nangular.module('openshiftConsole')\r\n  .controller('foo', function (AlertMessageService, DataService, DeploymentsService, ProjectsService) {\r\n \r\n// vs\r\nangular.module('openshiftConsole')\r\n  .controller('foo', function (Alerts, Data, Deployments, Projects) {\r\n```","created_at":"2015-12-16T16:20:20Z","updated_at":"2015-12-16T16:20:20Z","html_url":"https://github.com/openshift/origin/pull/6333#discussion_r47796759","pull_request_url":"https://api.github.com/repos/openshift/origin/pulls/6333","_links":{"self":{"href":"https://api.github.com/repos/openshift/origin/pulls/comments/47796759"},"html":{"href":"https://github.com/openshift/origin/pull/6333#discussion_r47796759"},"pull_request":{"href":"https://api.github.com/repos/openshift/origin/pulls/6333"}}},"pull_request":{"url":"https://api.github.com/repos/openshift/origin/pulls/6333","id":53798114,"html_url":"https://github.com/openshift/origin/pull/6333","diff_url":"https://github.com/openshift/origin/pull/6333.diff","patch_url":"https://github.com/openshift/origin/pull/6333.patch","issue_url":"https://api.github.com/repos/openshift/origin/issues/6333","number":6333,"state":"open","locked":false,"title":"[WIP] Add support for api groups","user":{"login":"benjaminapetersen","id":280512,"avatar_url":"https://avatars.githubusercontent.com/u/280512?v=3","gravatar_id":"","url":"https://api.github.com/users/benjaminapetersen","html_url":"https://github.com/benjaminapetersen","followers_url":"https://api.github.com/users/benjaminapetersen/followers","following_url":"https://api.github.com/users/benjaminapetersen/following{/other_user}","gists_url":"https://api.github.com/users/benjaminapetersen/gists{/gist_id}","starred_url":"https://api.github.com/users/benjaminapetersen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjaminapetersen/subscriptions","organizations_url":"https://api.github.com/users/benjaminapetersen/orgs","repos_url":"https://api.github.com/users/benjaminapetersen/repos","events_url":"https://api.github.com/users/benjaminapetersen/events{/privacy}","received_events_url":"https://api.github.com/users/benjaminapetersen/received_events","type":"User","site_admin":false},"body":"To make this easier, I factored the url building components from `DataService` into `ApiEndpointService` so I could make a `v2` version to drop in.  Both are in this PR, but the `v1` will be removed as it does not support groups.  I broke some of the larger functions into smaller so it would be easier to port.   \r\n\r\nThe `config.js` file will get a new map of apis that will look something like this:\r\n\r\n```javascript\r\nwindow.OPENSHIFT_CONFIG = {\r\n  \"groupVersions\" : [\r\n      {\r\n        \"group\":      \"\",\r\n        \"version\":    \"v1\",\r\n        \"hostPort\":   \"localhost:8443\",\r\n        \"prefix\":     \"/oapi\",\r\n        \"resources\":  [\"builds\",\"buildconfigs\", \"deploymentconfigs\", \"imagestreams\", \"other\", \"things\"]\r\n      },\r\n      {\r\n        \"group\":      \"\",\r\n        \"version\":    \"v1\",\r\n        \"hostPort\":   \"localhost:8443\",\r\n        \"prefix\":     \"/api\",\r\n        \"resources\":  [\"pods\", \"namespaces\", \"podtemplates\", \"replicationcontrollers\"]\r\n      },\r\n      {\r\n        \"group\":      \"extensions\",\r\n        \"version\":    \"v1beta1\",\r\n        \"hostPort\":   \"localhost:8443\",\r\n        \"prefix\":     \"/apis\",\r\n        \"resources\":  [\"jobs\", \"\"]\r\n      },\r\n      {\r\n        \"group\" :       \"experimental\",\r\n        \"version\" :     \"v1beta1\",\r\n        \"hostPort\" :    \"localhost:8443\",\r\n        \"prefix\" :      \"/apis\",\r\n        \"resources\" :   [\"horizontalpodautoscalers\"]\r\n      }\r\n  ]\r\n```\r\nWhich is transformed into this :\r\n```javascript\r\n{\r\n    \"\": {\r\n        \"v1\": {\r\n            \"builds\": {\r\n                \"hostPort\":\"localhost:8443\",\r\n                \"prefix\":\"/oapi\"\r\n            },\r\n            \"pods\": {\r\n                \"hostPort\":\"localhost:8443\",\r\n                \"prefix\":\"/api\"\r\n            }\r\n        }\r\n    },\r\n    \"extensions\": {\r\n        \"v1beta1\": {\r\n            \"jobs\": {\r\n                \"hostPort\":\"localhost:8443\",\r\n                \"prefix\":\"/apis\"\r\n            }\r\n        }\r\n    }\r\n}\r\n```\r\nvia the `mapApis` fn in `apiEndpoint_v2.js` (which also has a fn to map the old version of apis on config.js to the same format).  \r\n\r\nThere is a longer discussion about the details [on this gist](https://gist.github.com/benjaminapetersen/540ac605d3c1b0660062).\r\n\r\nOpen for feedback!\r\n\r\n@jwforres @spadgett @liggitt thougths?  ","created_at":"2015-12-16T04:30:32Z","updated_at":"2015-12-16T16:20:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5ea587fbe2e457fa70751aa9d55008f272e851da","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/openshift/origin/pulls/6333/commits","review_comments_url":"https://api.github.com/repos/openshift/origin/pulls/6333/comments","review_comment_url":"https://api.github.com/repos/openshift/origin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openshift/origin/issues/6333/comments","statuses_url":"https://api.github.com/repos/openshift/origin/statuses/c7ecc67ab4e6cdf7ff701d847f541b9a1836f8bd","head":{"label":"benjaminapetersen:bpeterse/api-groups","ref":"bpeterse/api-groups","sha":"c7ecc67ab4e6cdf7ff701d847f541b9a1836f8bd","user":{"login":"benjaminapetersen","id":280512,"avatar_url":"https://avatars.githubusercontent.com/u/280512?v=3","gravatar_id":"","url":"https://api.github.com/users/benjaminapetersen","html_url":"https://github.com/benjaminapetersen","followers_url":"https://api.github.com/users/benjaminapetersen/followers","following_url":"https://api.github.com/users/benjaminapetersen/following{/other_user}","gists_url":"https://api.github.com/users/benjaminapetersen/gists{/gist_id}","starred_url":"https://api.github.com/users/benjaminapetersen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjaminapetersen/subscriptions","organizations_url":"https://api.github.com/users/benjaminapetersen/orgs","repos_url":"https://api.github.com/users/benjaminapetersen/repos","events_url":"https://api.github.com/users/benjaminapetersen/events{/privacy}","received_events_url":"https://api.github.com/users/benjaminapetersen/received_events","type":"User","site_admin":false},"repo":{"id":37674696,"name":"origin","full_name":"benjaminapetersen/origin","owner":{"login":"benjaminapetersen","id":280512,"avatar_url":"https://avatars.githubusercontent.com/u/280512?v=3","gravatar_id":"","url":"https://api.github.com/users/benjaminapetersen","html_url":"https://github.com/benjaminapetersen","followers_url":"https://api.github.com/users/benjaminapetersen/followers","following_url":"https://api.github.com/users/benjaminapetersen/following{/other_user}","gists_url":"https://api.github.com/users/benjaminapetersen/gists{/gist_id}","starred_url":"https://api.github.com/users/benjaminapetersen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjaminapetersen/subscriptions","organizations_url":"https://api.github.com/users/benjaminapetersen/orgs","repos_url":"https://api.github.com/users/benjaminapetersen/repos","events_url":"https://api.github.com/users/benjaminapetersen/events{/privacy}","received_events_url":"https://api.github.com/users/benjaminapetersen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/benjaminapetersen/origin","description":"OpenShift 3 - build, deploy, and manage your applications with Docker and Kubernetes","fork":true,"url":"https://api.github.com/repos/benjaminapetersen/origin","forks_url":"https://api.github.com/repos/benjaminapetersen/origin/forks","keys_url":"https://api.github.com/repos/benjaminapetersen/origin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/benjaminapetersen/origin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/benjaminapetersen/origin/teams","hooks_url":"https://api.github.com/repos/benjaminapetersen/origin/hooks","issue_events_url":"https://api.github.com/repos/benjaminapetersen/origin/issues/events{/number}","events_url":"https://api.github.com/repos/benjaminapetersen/origin/events","assignees_url":"https://api.github.com/repos/benjaminapetersen/origin/assignees{/user}","branches_url":"https://api.github.com/repos/benjaminapetersen/origin/branches{/branch}","tags_url":"https://api.github.com/repos/benjaminapetersen/origin/tags","blobs_url":"https://api.github.com/repos/benjaminapetersen/origin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/benjaminapetersen/origin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/benjaminapetersen/origin/git/refs{/sha}","trees_url":"https://api.github.com/repos/benjaminapetersen/origin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/benjaminapetersen/origin/statuses/{sha}","languages_url":"https://api.github.com/repos/benjaminapetersen/origin/languages","stargazers_url":"https://api.github.com/repos/benjaminapetersen/origin/stargazers","contributors_url":"https://api.github.com/repos/benjaminapetersen/origin/contributors","subscribers_url":"https://api.github.com/repos/benjaminapetersen/origin/subscribers","subscription_url":"https://api.github.com/repos/benjaminapetersen/origin/subscription","commits_url":"https://api.github.com/repos/benjaminapetersen/origin/commits{/sha}","git_commits_url":"https://api.github.com/repos/benjaminapetersen/origin/git/commits{/sha}","comments_url":"https://api.github.com/repos/benjaminapetersen/origin/comments{/number}","issue_comment_url":"https://api.github.com/repos/benjaminapetersen/origin/issues/comments{/number}","contents_url":"https://api.github.com/repos/benjaminapetersen/origin/contents/{+path}","compare_url":"https://api.github.com/repos/benjaminapetersen/origin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/benjaminapetersen/origin/merges","archive_url":"https://api.github.com/repos/benjaminapetersen/origin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/benjaminapetersen/origin/downloads","issues_url":"https://api.github.com/repos/benjaminapetersen/origin/issues{/number}","pulls_url":"https://api.github.com/repos/benjaminapetersen/origin/pulls{/number}","milestones_url":"https://api.github.com/repos/benjaminapetersen/origin/milestones{/number}","notifications_url":"https://api.github.com/repos/benjaminapetersen/origin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/benjaminapetersen/origin/labels{/name}","releases_url":"https://api.github.com/repos/benjaminapetersen/origin/releases{/id}","created_at":"2015-06-18T17:38:49Z","updated_at":"2015-06-18T17:38:52Z","pushed_at":"2015-12-16T04:22:05Z","git_url":"git://github.com/benjaminapetersen/origin.git","ssh_url":"git@github.com:benjaminapetersen/origin.git","clone_url":"https://github.com/benjaminapetersen/origin.git","svn_url":"https://github.com/benjaminapetersen/origin","homepage":"http://www.openshift.org","size":180748,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"bpeterse/bug/3436-osc-key-value"}},"base":{"label":"openshift:master","ref":"master","sha":"f7e2d9d2a61ef311f89c307c45ea5802d3daf17f","user":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"repo":{"id":22442668,"name":"origin","full_name":"openshift/origin","owner":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openshift/origin","description":"OpenShift 3 - build, deploy, and manage your applications with Docker and Kubernetes","fork":false,"url":"https://api.github.com/repos/openshift/origin","forks_url":"https://api.github.com/repos/openshift/origin/forks","keys_url":"https://api.github.com/repos/openshift/origin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openshift/origin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openshift/origin/teams","hooks_url":"https://api.github.com/repos/openshift/origin/hooks","issue_events_url":"https://api.github.com/repos/openshift/origin/issues/events{/number}","events_url":"https://api.github.com/repos/openshift/origin/events","assignees_url":"https://api.github.com/repos/openshift/origin/assignees{/user}","branches_url":"https://api.github.com/repos/openshift/origin/branches{/branch}","tags_url":"https://api.github.com/repos/openshift/origin/tags","blobs_url":"https://api.github.com/repos/openshift/origin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openshift/origin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openshift/origin/git/refs{/sha}","trees_url":"https://api.github.com/repos/openshift/origin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openshift/origin/statuses/{sha}","languages_url":"https://api.github.com/repos/openshift/origin/languages","stargazers_url":"https://api.github.com/repos/openshift/origin/stargazers","contributors_url":"https://api.github.com/repos/openshift/origin/contributors","subscribers_url":"https://api.github.com/repos/openshift/origin/subscribers","subscription_url":"https://api.github.com/repos/openshift/origin/subscription","commits_url":"https://api.github.com/repos/openshift/origin/commits{/sha}","git_commits_url":"https://api.github.com/repos/openshift/origin/git/commits{/sha}","comments_url":"https://api.github.com/repos/openshift/origin/comments{/number}","issue_comment_url":"https://api.github.com/repos/openshift/origin/issues/comments{/number}","contents_url":"https://api.github.com/repos/openshift/origin/contents/{+path}","compare_url":"https://api.github.com/repos/openshift/origin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openshift/origin/merges","archive_url":"https://api.github.com/repos/openshift/origin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openshift/origin/downloads","issues_url":"https://api.github.com/repos/openshift/origin/issues{/number}","pulls_url":"https://api.github.com/repos/openshift/origin/pulls{/number}","milestones_url":"https://api.github.com/repos/openshift/origin/milestones{/number}","notifications_url":"https://api.github.com/repos/openshift/origin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openshift/origin/labels{/name}","releases_url":"https://api.github.com/repos/openshift/origin/releases{/id}","created_at":"2014-07-30T20:04:05Z","updated_at":"2015-12-16T11:15:50Z","pushed_at":"2015-12-16T16:12:57Z","git_url":"git://github.com/openshift/origin.git","ssh_url":"git@github.com:openshift/origin.git","clone_url":"https://github.com/openshift/origin.git","svn_url":"https://github.com/openshift/origin","homepage":"http://www.openshift.org","size":230979,"stargazers_count":869,"watchers_count":869,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":554,"mirror_url":null,"open_issues_count":750,"forks":554,"open_issues":750,"watchers":869,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openshift/origin/pulls/6333"},"html":{"href":"https://github.com/openshift/origin/pull/6333"},"issue":{"href":"https://api.github.com/repos/openshift/origin/issues/6333"},"comments":{"href":"https://api.github.com/repos/openshift/origin/issues/6333/comments"},"review_comments":{"href":"https://api.github.com/repos/openshift/origin/pulls/6333/comments"},"review_comment":{"href":"https://api.github.com/repos/openshift/origin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openshift/origin/pulls/6333/commits"},"statuses":{"href":"https://api.github.com/repos/openshift/origin/statuses/c7ecc67ab4e6cdf7ff701d847f541b9a1836f8bd"}}}}