{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/37675544","id":37675544,"diff_hunk":"@@ -0,0 +1,68 @@\n+/*\n+Copyright 2015 The Kubernetes Authors All rights reserved.\n+\n+Licensed under the Apache License, Version 2.0 (the \"License\");\n+you may not use this file except in compliance with the License.\n+You may obtain a copy of the License at\n+\n+    http://www.apache.org/licenses/LICENSE-2.0\n+\n+Unless required by applicable law or agreed to in writing, software\n+distributed under the License is distributed on an \"AS IS\" BASIS,\n+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+See the License for the specific language governing permissions and\n+limitations under the License.\n+*/\n+\n+package etcd\n+\n+import (\n+\t\"k8s.io/kubernetes/pkg/api\"\n+\t\"k8s.io/kubernetes/pkg/expapi\"\n+\t\"k8s.io/kubernetes/pkg/fields\"\n+\t\"k8s.io/kubernetes/pkg/labels\"\n+\t\"k8s.io/kubernetes/pkg/registry/generic\"\n+\tetcdgeneric \"k8s.io/kubernetes/pkg/registry/generic/etcd\"\n+\t\"k8s.io/kubernetes/pkg/registry/nodemetrics\"\n+\t\"k8s.io/kubernetes/pkg/runtime\"\n+\t\"k8s.io/kubernetes/pkg/storage\"\n+)\n+\n+// REST implements a RESTStorage for node metrics against etcd.\n+type REST struct {\n+\t*etcdgeneric.Etcd\n+}\n+\n+// NewREST returns a RESTStorage object that will work against node metrics.\n+func NewREST(s storage.Interface) *REST {\n+\tvar prefix = \"/nodemetrics\"\n+\tstore := &etcdgeneric.Etcd{\n+\t\tNewFunc: func() runtime.Object {\n+\t\t\treturn &expapi.DerivedNodeMetrics{}\n+\t\t},\n+\t\tNewListFunc: func() runtime.Object {\n+\t\t\treturn &expapi.DerivedNodeMetricsList{}\n+\t\t},\n+\t\tKeyRootFunc: func(ctx api.Context) string {\n+\t\t\treturn etcdgeneric.NamespaceKeyRootFunc(ctx, prefix)\n+\t\t},\n+\t\tKeyFunc: func(ctx api.Context, name string) (string, error) {\n+\t\t\treturn etcdgeneric.NamespaceKeyFunc(ctx, prefix, name)\n+\t\t},\n+\t\tObjectNameFunc: func(obj runtime.Object) (string, error) {\n+\t\t\treturn obj.(*expapi.DerivedNodeMetrics).Name, nil\n+\t\t},\n+\t\tPredicateFunc: func(label labels.Selector, field fields.Selector) generic.Matcher {","path":"pkg/registry/nodemetrics/etcd/etcd.go","position":55,"original_position":55,"commit_id":"7cd221683e4506fa2391972fb5f71864d9f12fa2","original_commit_id":"7cd221683e4506fa2391972fb5f71864d9f12fa2","user":{"login":"smarterclayton","id":1163175,"avatar_url":"https://avatars.githubusercontent.com/u/1163175?v=3","gravatar_id":"","url":"https://api.github.com/users/smarterclayton","html_url":"https://github.com/smarterclayton","followers_url":"https://api.github.com/users/smarterclayton/followers","following_url":"https://api.github.com/users/smarterclayton/following{/other_user}","gists_url":"https://api.github.com/users/smarterclayton/gists{/gist_id}","starred_url":"https://api.github.com/users/smarterclayton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarterclayton/subscriptions","organizations_url":"https://api.github.com/users/smarterclayton/orgs","repos_url":"https://api.github.com/users/smarterclayton/repos","events_url":"https://api.github.com/users/smarterclayton/events{/privacy}","received_events_url":"https://api.github.com/users/smarterclayton/received_events","type":"User","site_admin":false},"body":"Should be `PredicateFunc: nodemetrics.MatchDerivedNodeMetrics`","created_at":"2015-08-21T20:37:11Z","updated_at":"2015-08-21T20:37:11Z","html_url":"https://github.com/kubernetes/kubernetes/pull/12952#discussion_r37675544","pull_request_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/12952","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/37675544"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/12952#discussion_r37675544"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/12952"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/12952","id":42878567,"html_url":"https://github.com/kubernetes/kubernetes/pull/12952","diff_url":"https://github.com/kubernetes/kubernetes/pull/12952.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/12952.patch","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/12952","number":12952,"state":"open","locked":false,"title":"WIP: apiserver nodemetrics endpoint","user":{"login":"mvdan","id":3576549,"avatar_url":"https://avatars.githubusercontent.com/u/3576549?v=3","gravatar_id":"","url":"https://api.github.com/users/mvdan","html_url":"https://github.com/mvdan","followers_url":"https://api.github.com/users/mvdan/followers","following_url":"https://api.github.com/users/mvdan/following{/other_user}","gists_url":"https://api.github.com/users/mvdan/gists{/gist_id}","starred_url":"https://api.github.com/users/mvdan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mvdan/subscriptions","organizations_url":"https://api.github.com/users/mvdan/orgs","repos_url":"https://api.github.com/users/mvdan/repos","events_url":"https://api.github.com/users/mvdan/events{/privacy}","received_events_url":"https://api.github.com/users/mvdan/received_events","type":"User","site_admin":false},"body":"Based on proposal: #11951 ","created_at":"2015-08-20T00:02:41Z","updated_at":"2015-08-21T20:37:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"94f48295bb2fefbeeac5ab44b0197f52f96ff197","assignee":{"login":"smarterclayton","id":1163175,"avatar_url":"https://avatars.githubusercontent.com/u/1163175?v=3","gravatar_id":"","url":"https://api.github.com/users/smarterclayton","html_url":"https://github.com/smarterclayton","followers_url":"https://api.github.com/users/smarterclayton/followers","following_url":"https://api.github.com/users/smarterclayton/following{/other_user}","gists_url":"https://api.github.com/users/smarterclayton/gists{/gist_id}","starred_url":"https://api.github.com/users/smarterclayton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarterclayton/subscriptions","organizations_url":"https://api.github.com/users/smarterclayton/orgs","repos_url":"https://api.github.com/users/smarterclayton/repos","events_url":"https://api.github.com/users/smarterclayton/events{/privacy}","received_events_url":"https://api.github.com/users/smarterclayton/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/12952/commits","review_comments_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/12952/comments","review_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/12952/comments","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/7cd221683e4506fa2391972fb5f71864d9f12fa2","head":{"label":"mvdan:apiserver-nodemetrics-endpoint","ref":"apiserver-nodemetrics-endpoint","sha":"7cd221683e4506fa2391972fb5f71864d9f12fa2","user":{"login":"mvdan","id":3576549,"avatar_url":"https://avatars.githubusercontent.com/u/3576549?v=3","gravatar_id":"","url":"https://api.github.com/users/mvdan","html_url":"https://github.com/mvdan","followers_url":"https://api.github.com/users/mvdan/followers","following_url":"https://api.github.com/users/mvdan/following{/other_user}","gists_url":"https://api.github.com/users/mvdan/gists{/gist_id}","starred_url":"https://api.github.com/users/mvdan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mvdan/subscriptions","organizations_url":"https://api.github.com/users/mvdan/orgs","repos_url":"https://api.github.com/users/mvdan/repos","events_url":"https://api.github.com/users/mvdan/events{/privacy}","received_events_url":"https://api.github.com/users/mvdan/received_events","type":"User","site_admin":false},"repo":{"id":30264775,"name":"kubernetes","full_name":"mvdan/kubernetes","owner":{"login":"mvdan","id":3576549,"avatar_url":"https://avatars.githubusercontent.com/u/3576549?v=3","gravatar_id":"","url":"https://api.github.com/users/mvdan","html_url":"https://github.com/mvdan","followers_url":"https://api.github.com/users/mvdan/followers","following_url":"https://api.github.com/users/mvdan/following{/other_user}","gists_url":"https://api.github.com/users/mvdan/gists{/gist_id}","starred_url":"https://api.github.com/users/mvdan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mvdan/subscriptions","organizations_url":"https://api.github.com/users/mvdan/orgs","repos_url":"https://api.github.com/users/mvdan/repos","events_url":"https://api.github.com/users/mvdan/events{/privacy}","received_events_url":"https://api.github.com/users/mvdan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mvdan/kubernetes","description":"Container Cluster Manager","fork":true,"url":"https://api.github.com/repos/mvdan/kubernetes","forks_url":"https://api.github.com/repos/mvdan/kubernetes/forks","keys_url":"https://api.github.com/repos/mvdan/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mvdan/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mvdan/kubernetes/teams","hooks_url":"https://api.github.com/repos/mvdan/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/mvdan/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/mvdan/kubernetes/events","assignees_url":"https://api.github.com/repos/mvdan/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/mvdan/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/mvdan/kubernetes/tags","blobs_url":"https://api.github.com/repos/mvdan/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mvdan/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mvdan/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/mvdan/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mvdan/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/mvdan/kubernetes/languages","stargazers_url":"https://api.github.com/repos/mvdan/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/mvdan/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/mvdan/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/mvdan/kubernetes/subscription","commits_url":"https://api.github.com/repos/mvdan/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/mvdan/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/mvdan/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/mvdan/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/mvdan/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/mvdan/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mvdan/kubernetes/merges","archive_url":"https://api.github.com/repos/mvdan/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mvdan/kubernetes/downloads","issues_url":"https://api.github.com/repos/mvdan/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/mvdan/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/mvdan/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/mvdan/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mvdan/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/mvdan/kubernetes/releases{/id}","created_at":"2015-02-03T21:10:50Z","updated_at":"2015-02-03T21:10:54Z","pushed_at":"2015-08-21T20:01:46Z","git_url":"git://github.com/mvdan/kubernetes.git","ssh_url":"git@github.com:mvdan/kubernetes.git","clone_url":"https://github.com/mvdan/kubernetes.git","svn_url":"https://github.com/mvdan/kubernetes","homepage":"http://kubernetes.io","size":100921,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kubernetes:master","ref":"master","sha":"8800450c5f163067b2fcbbedfae4bb4ec7cec31e","user":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"repo":{"id":20580498,"name":"kubernetes","full_name":"kubernetes/kubernetes","owner":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kubernetes/kubernetes","description":"Container Cluster Manager from Google","fork":false,"url":"https://api.github.com/repos/kubernetes/kubernetes","forks_url":"https://api.github.com/repos/kubernetes/kubernetes/forks","keys_url":"https://api.github.com/repos/kubernetes/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kubernetes/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kubernetes/kubernetes/teams","hooks_url":"https://api.github.com/repos/kubernetes/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/kubernetes/kubernetes/events","assignees_url":"https://api.github.com/repos/kubernetes/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/kubernetes/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/kubernetes/kubernetes/tags","blobs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kubernetes/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/kubernetes/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/kubernetes/kubernetes/languages","stargazers_url":"https://api.github.com/repos/kubernetes/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/kubernetes/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/kubernetes/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/kubernetes/kubernetes/subscription","commits_url":"https://api.github.com/repos/kubernetes/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/kubernetes/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/kubernetes/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/kubernetes/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kubernetes/kubernetes/merges","archive_url":"https://api.github.com/repos/kubernetes/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kubernetes/kubernetes/downloads","issues_url":"https://api.github.com/repos/kubernetes/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/kubernetes/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/kubernetes/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/kubernetes/kubernetes/releases{/id}","created_at":"2014-06-06T22:56:04Z","updated_at":"2015-08-21T20:31:47Z","pushed_at":"2015-08-21T20:32:15Z","git_url":"git://github.com/kubernetes/kubernetes.git","ssh_url":"git@github.com:kubernetes/kubernetes.git","clone_url":"https://github.com/kubernetes/kubernetes.git","svn_url":"https://github.com/kubernetes/kubernetes","homepage":"http://kubernetes.io","size":358286,"stargazers_count":9830,"watchers_count":9830,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2371,"mirror_url":null,"open_issues_count":1782,"forks":2371,"open_issues":1782,"watchers":9830,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/12952"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/12952"},"issue":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/12952"},"comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/12952/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/12952/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/12952/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/kubernetes/statuses/7cd221683e4506fa2391972fb5f71864d9f12fa2"}}}}