{"action":"created","issue":{"url":"https://api.github.com/repos/openshift/origin/issues/6333","labels_url":"https://api.github.com/repos/openshift/origin/issues/6333/labels{/name}","comments_url":"https://api.github.com/repos/openshift/origin/issues/6333/comments","events_url":"https://api.github.com/repos/openshift/origin/issues/6333/events","html_url":"https://github.com/openshift/origin/pull/6333","id":122426607,"number":6333,"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},"labels":[{"url":"https://api.github.com/repos/openshift/origin/labels/component/web","name":"component/web","color":"0052cc"}],"state":"open","locked":false,"assignee":{"login":"liggitt","id":980082,"avatar_url":"https://avatars.githubusercontent.com/u/980082?v=3","gravatar_id":"","url":"https://api.github.com/users/liggitt","html_url":"https://github.com/liggitt","followers_url":"https://api.github.com/users/liggitt/followers","following_url":"https://api.github.com/users/liggitt/following{/other_user}","gists_url":"https://api.github.com/users/liggitt/gists{/gist_id}","starred_url":"https://api.github.com/users/liggitt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liggitt/subscriptions","organizations_url":"https://api.github.com/users/liggitt/orgs","repos_url":"https://api.github.com/users/liggitt/repos","events_url":"https://api.github.com/users/liggitt/events{/privacy}","received_events_url":"https://api.github.com/users/liggitt/received_events","type":"User","site_admin":false},"milestone":null,"comments":10,"created_at":"2015-12-16T04:30:32Z","updated_at":"2016-01-30T04:00:17Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/openshift/origin/pulls/6333","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"},"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?  "},"comment":{"url":"https://api.github.com/repos/openshift/origin/issues/comments/177061168","html_url":"https://github.com/openshift/origin/pull/6333#issuecomment-177061168","issue_url":"https://api.github.com/repos/openshift/origin/issues/6333","id":177061168,"user":{"login":"openshift-bot","id":1779249,"avatar_url":"https://avatars.githubusercontent.com/u/1779249?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift-bot","html_url":"https://github.com/openshift-bot","followers_url":"https://api.github.com/users/openshift-bot/followers","following_url":"https://api.github.com/users/openshift-bot/following{/other_user}","gists_url":"https://api.github.com/users/openshift-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift-bot/subscriptions","organizations_url":"https://api.github.com/users/openshift-bot/orgs","repos_url":"https://api.github.com/users/openshift-bot/repos","events_url":"https://api.github.com/users/openshift-bot/events{/privacy}","received_events_url":"https://api.github.com/users/openshift-bot/received_events","type":"User","site_admin":false},"created_at":"2016-01-30T04:00:17Z","updated_at":"2016-01-30T04:00:17Z","body":"Origin Action Required: Pull request cannot be automatically merged, please rebase your branch from latest HEAD and push again"}}