{"action":"created","comment":{"url":"https://api.github.com/repos/rook/rook/pulls/comments/99858681","pull_request_review_id":20546486,"id":99858681,"diff_hunk":"@@ -0,0 +1,74 @@\n+// +build linux,amd64 linux,arm64\n+\n+/*\n+Copyright 2016 The Rook 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+\thttp://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+package main\n+\n+import (\n+\t\"fmt\"\n+\t\"os\"\n+\n+\t\"github.com/rook/rook/pkg/api\"\n+\tapik8s \"github.com/rook/rook/pkg/api/k8s\"\n+\t\"github.com/rook/rook/pkg/cephmgr/cephd\"\n+\t\"github.com/rook/rook/pkg/cephmgr/mon\"\n+\t\"github.com/rook/rook/pkg/clusterd\"\n+\t\"github.com/rook/rook/pkg/util/flags\"\n+\t\"github.com/spf13/cobra\"\n+)\n+\n+var restapiCmd = &cobra.Command{\n+\tUse:    \"restapi\",\n+\tShort:  \"Runs the Rook REST API service\",\n+\tHidden: true,\n+}\n+var restapiPort int\n+\n+func init() {\n+\trestapiCmd.Flags().IntVar(&restapiPort, \"rest-api-port\", 0, \"rest api port number\")\n+\n+\tflags.SetFlagsFromEnv(rootCmd.Flags(), \"ROOK_OPERATOR\")\n+\n+\trestapiCmd.RunE = startRest\n+}\n+\n+func startRest(cmd *cobra.Command, args []string) error {\n+\tif err := flags.VerifyRequiredFlags(restapiCmd, []string{\"data-dir\", \"cluster-name\", \"mon-endpoints\", \"mon-secret\", \"admin-secret\"}); err != nil {\n+\t\treturn err\n+\t}\n+\tif restapiPort == 0 {\n+\t\treturn fmt.Errorf(\"rest-port is required\")","path":"cmd/rook-operator/restapi.go","position":53,"original_position":53,"commit_id":"bfa30b00129dfd28c154f3c7a497f3daf7c77b67","original_commit_id":"bfa30b00129dfd28c154f3c7a497f3daf7c77b67","user":{"login":"travisn","id":1048514,"avatar_url":"https://avatars.githubusercontent.com/u/1048514?v=3","gravatar_id":"","url":"https://api.github.com/users/travisn","html_url":"https://github.com/travisn","followers_url":"https://api.github.com/users/travisn/followers","following_url":"https://api.github.com/users/travisn/following{/other_user}","gists_url":"https://api.github.com/users/travisn/gists{/gist_id}","starred_url":"https://api.github.com/users/travisn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/travisn/subscriptions","organizations_url":"https://api.github.com/users/travisn/orgs","repos_url":"https://api.github.com/users/travisn/repos","events_url":"https://api.github.com/users/travisn/events{/privacy}","received_events_url":"https://api.github.com/users/travisn/received_events","type":"User","site_admin":false},"body":"the naming was bugging me too, i'm removing \"rest\" from the naming convention in a few places, thanks.","created_at":"2017-02-07T16:10:44Z","updated_at":"2017-02-07T16:13:05Z","html_url":"https://github.com/rook/rook/pull/369#discussion_r99858681","pull_request_url":"https://api.github.com/repos/rook/rook/pulls/369","_links":{"self":{"href":"https://api.github.com/repos/rook/rook/pulls/comments/99858681"},"html":{"href":"https://github.com/rook/rook/pull/369#discussion_r99858681"},"pull_request":{"href":"https://api.github.com/repos/rook/rook/pulls/369"}}},"pull_request":{"url":"https://api.github.com/repos/rook/rook/pulls/369","id":104593227,"html_url":"https://github.com/rook/rook/pull/369","diff_url":"https://github.com/rook/rook/pull/369.diff","patch_url":"https://github.com/rook/rook/pull/369.patch","issue_url":"https://api.github.com/repos/rook/rook/issues/369","number":369,"state":"open","locked":false,"title":"Rook REST api started by the operator","user":{"login":"travisn","id":1048514,"avatar_url":"https://avatars.githubusercontent.com/u/1048514?v=3","gravatar_id":"","url":"https://api.github.com/users/travisn","html_url":"https://github.com/travisn","followers_url":"https://api.github.com/users/travisn/followers","following_url":"https://api.github.com/users/travisn/following{/other_user}","gists_url":"https://api.github.com/users/travisn/gists{/gist_id}","starred_url":"https://api.github.com/users/travisn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/travisn/subscriptions","organizations_url":"https://api.github.com/users/travisn/orgs","repos_url":"https://api.github.com/users/travisn/repos","events_url":"https://api.github.com/users/travisn/events{/privacy}","received_events_url":"https://api.github.com/users/travisn/received_events","type":"User","site_admin":false},"body":"The Rook operator will launch the REST api service. The api service has implemented object store creation, listing of nodes, and all apis that query ceph for info. Still to be implemented is the `rook filesystem` command.","created_at":"2017-02-03T19:11:31Z","updated_at":"2017-02-07T16:13:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5997c207de509badf509c633103ce5d59bb2ac18","assignee":{"login":"kokhang","id":1672672,"avatar_url":"https://avatars.githubusercontent.com/u/1672672?v=3","gravatar_id":"","url":"https://api.github.com/users/kokhang","html_url":"https://github.com/kokhang","followers_url":"https://api.github.com/users/kokhang/followers","following_url":"https://api.github.com/users/kokhang/following{/other_user}","gists_url":"https://api.github.com/users/kokhang/gists{/gist_id}","starred_url":"https://api.github.com/users/kokhang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kokhang/subscriptions","organizations_url":"https://api.github.com/users/kokhang/orgs","repos_url":"https://api.github.com/users/kokhang/repos","events_url":"https://api.github.com/users/kokhang/events{/privacy}","received_events_url":"https://api.github.com/users/kokhang/received_events","type":"User","site_admin":false},"assignees":[{"login":"kokhang","id":1672672,"avatar_url":"https://avatars.githubusercontent.com/u/1672672?v=3","gravatar_id":"","url":"https://api.github.com/users/kokhang","html_url":"https://github.com/kokhang","followers_url":"https://api.github.com/users/kokhang/followers","following_url":"https://api.github.com/users/kokhang/following{/other_user}","gists_url":"https://api.github.com/users/kokhang/gists{/gist_id}","starred_url":"https://api.github.com/users/kokhang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kokhang/subscriptions","organizations_url":"https://api.github.com/users/kokhang/orgs","repos_url":"https://api.github.com/users/kokhang/repos","events_url":"https://api.github.com/users/kokhang/events{/privacy}","received_events_url":"https://api.github.com/users/kokhang/received_events","type":"User","site_admin":false},{"login":"jbw976","id":4313439,"avatar_url":"https://avatars.githubusercontent.com/u/4313439?v=3","gravatar_id":"","url":"https://api.github.com/users/jbw976","html_url":"https://github.com/jbw976","followers_url":"https://api.github.com/users/jbw976/followers","following_url":"https://api.github.com/users/jbw976/following{/other_user}","gists_url":"https://api.github.com/users/jbw976/gists{/gist_id}","starred_url":"https://api.github.com/users/jbw976/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbw976/subscriptions","organizations_url":"https://api.github.com/users/jbw976/orgs","repos_url":"https://api.github.com/users/jbw976/repos","events_url":"https://api.github.com/users/jbw976/events{/privacy}","received_events_url":"https://api.github.com/users/jbw976/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/rook/rook/pulls/369/commits","review_comments_url":"https://api.github.com/repos/rook/rook/pulls/369/comments","review_comment_url":"https://api.github.com/repos/rook/rook/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rook/rook/issues/369/comments","statuses_url":"https://api.github.com/repos/rook/rook/statuses/bfa30b00129dfd28c154f3c7a497f3daf7c77b67","head":{"label":"travisn:k8s-rest-api","ref":"k8s-rest-api","sha":"bfa30b00129dfd28c154f3c7a497f3daf7c77b67","user":{"login":"travisn","id":1048514,"avatar_url":"https://avatars.githubusercontent.com/u/1048514?v=3","gravatar_id":"","url":"https://api.github.com/users/travisn","html_url":"https://github.com/travisn","followers_url":"https://api.github.com/users/travisn/followers","following_url":"https://api.github.com/users/travisn/following{/other_user}","gists_url":"https://api.github.com/users/travisn/gists{/gist_id}","starred_url":"https://api.github.com/users/travisn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/travisn/subscriptions","organizations_url":"https://api.github.com/users/travisn/orgs","repos_url":"https://api.github.com/users/travisn/repos","events_url":"https://api.github.com/users/travisn/events{/privacy}","received_events_url":"https://api.github.com/users/travisn/received_events","type":"User","site_admin":false},"repo":{"id":73165238,"name":"rook","full_name":"travisn/rook","owner":{"login":"travisn","id":1048514,"avatar_url":"https://avatars.githubusercontent.com/u/1048514?v=3","gravatar_id":"","url":"https://api.github.com/users/travisn","html_url":"https://github.com/travisn","followers_url":"https://api.github.com/users/travisn/followers","following_url":"https://api.github.com/users/travisn/following{/other_user}","gists_url":"https://api.github.com/users/travisn/gists{/gist_id}","starred_url":"https://api.github.com/users/travisn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/travisn/subscriptions","organizations_url":"https://api.github.com/users/travisn/orgs","repos_url":"https://api.github.com/users/travisn/repos","events_url":"https://api.github.com/users/travisn/events{/privacy}","received_events_url":"https://api.github.com/users/travisn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/travisn/rook","description":"Open, Universal, Cloud Native, Distributed Storage","fork":true,"url":"https://api.github.com/repos/travisn/rook","forks_url":"https://api.github.com/repos/travisn/rook/forks","keys_url":"https://api.github.com/repos/travisn/rook/keys{/key_id}","collaborators_url":"https://api.github.com/repos/travisn/rook/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/travisn/rook/teams","hooks_url":"https://api.github.com/repos/travisn/rook/hooks","issue_events_url":"https://api.github.com/repos/travisn/rook/issues/events{/number}","events_url":"https://api.github.com/repos/travisn/rook/events","assignees_url":"https://api.github.com/repos/travisn/rook/assignees{/user}","branches_url":"https://api.github.com/repos/travisn/rook/branches{/branch}","tags_url":"https://api.github.com/repos/travisn/rook/tags","blobs_url":"https://api.github.com/repos/travisn/rook/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/travisn/rook/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/travisn/rook/git/refs{/sha}","trees_url":"https://api.github.com/repos/travisn/rook/git/trees{/sha}","statuses_url":"https://api.github.com/repos/travisn/rook/statuses/{sha}","languages_url":"https://api.github.com/repos/travisn/rook/languages","stargazers_url":"https://api.github.com/repos/travisn/rook/stargazers","contributors_url":"https://api.github.com/repos/travisn/rook/contributors","subscribers_url":"https://api.github.com/repos/travisn/rook/subscribers","subscription_url":"https://api.github.com/repos/travisn/rook/subscription","commits_url":"https://api.github.com/repos/travisn/rook/commits{/sha}","git_commits_url":"https://api.github.com/repos/travisn/rook/git/commits{/sha}","comments_url":"https://api.github.com/repos/travisn/rook/comments{/number}","issue_comment_url":"https://api.github.com/repos/travisn/rook/issues/comments{/number}","contents_url":"https://api.github.com/repos/travisn/rook/contents/{+path}","compare_url":"https://api.github.com/repos/travisn/rook/compare/{base}...{head}","merges_url":"https://api.github.com/repos/travisn/rook/merges","archive_url":"https://api.github.com/repos/travisn/rook/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/travisn/rook/downloads","issues_url":"https://api.github.com/repos/travisn/rook/issues{/number}","pulls_url":"https://api.github.com/repos/travisn/rook/pulls{/number}","milestones_url":"https://api.github.com/repos/travisn/rook/milestones{/number}","notifications_url":"https://api.github.com/repos/travisn/rook/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/travisn/rook/labels{/name}","releases_url":"https://api.github.com/repos/travisn/rook/releases{/id}","deployments_url":"https://api.github.com/repos/travisn/rook/deployments","created_at":"2016-11-08T08:30:24Z","updated_at":"2016-11-08T08:30:25Z","pushed_at":"2017-02-07T15:41:46Z","git_url":"git://github.com/travisn/rook.git","ssh_url":"git@github.com:travisn/rook.git","clone_url":"https://github.com/travisn/rook.git","svn_url":"https://github.com/travisn/rook","homepage":"http://rook.io","size":1243,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rook:master","ref":"master","sha":"252db979bc56e7f5d36d98743c93fa8b0e4514e4","user":{"login":"rook","id":22860722,"avatar_url":"https://avatars.githubusercontent.com/u/22860722?v=3","gravatar_id":"","url":"https://api.github.com/users/rook","html_url":"https://github.com/rook","followers_url":"https://api.github.com/users/rook/followers","following_url":"https://api.github.com/users/rook/following{/other_user}","gists_url":"https://api.github.com/users/rook/gists{/gist_id}","starred_url":"https://api.github.com/users/rook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rook/subscriptions","organizations_url":"https://api.github.com/users/rook/orgs","repos_url":"https://api.github.com/users/rook/repos","events_url":"https://api.github.com/users/rook/events{/privacy}","received_events_url":"https://api.github.com/users/rook/received_events","type":"Organization","site_admin":false},"repo":{"id":62921553,"name":"rook","full_name":"rook/rook","owner":{"login":"rook","id":22860722,"avatar_url":"https://avatars.githubusercontent.com/u/22860722?v=3","gravatar_id":"","url":"https://api.github.com/users/rook","html_url":"https://github.com/rook","followers_url":"https://api.github.com/users/rook/followers","following_url":"https://api.github.com/users/rook/following{/other_user}","gists_url":"https://api.github.com/users/rook/gists{/gist_id}","starred_url":"https://api.github.com/users/rook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rook/subscriptions","organizations_url":"https://api.github.com/users/rook/orgs","repos_url":"https://api.github.com/users/rook/repos","events_url":"https://api.github.com/users/rook/events{/privacy}","received_events_url":"https://api.github.com/users/rook/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rook/rook","description":"Open, Cloud Native, and Universal Distributed Storage","fork":false,"url":"https://api.github.com/repos/rook/rook","forks_url":"https://api.github.com/repos/rook/rook/forks","keys_url":"https://api.github.com/repos/rook/rook/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rook/rook/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rook/rook/teams","hooks_url":"https://api.github.com/repos/rook/rook/hooks","issue_events_url":"https://api.github.com/repos/rook/rook/issues/events{/number}","events_url":"https://api.github.com/repos/rook/rook/events","assignees_url":"https://api.github.com/repos/rook/rook/assignees{/user}","branches_url":"https://api.github.com/repos/rook/rook/branches{/branch}","tags_url":"https://api.github.com/repos/rook/rook/tags","blobs_url":"https://api.github.com/repos/rook/rook/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rook/rook/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rook/rook/git/refs{/sha}","trees_url":"https://api.github.com/repos/rook/rook/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rook/rook/statuses/{sha}","languages_url":"https://api.github.com/repos/rook/rook/languages","stargazers_url":"https://api.github.com/repos/rook/rook/stargazers","contributors_url":"https://api.github.com/repos/rook/rook/contributors","subscribers_url":"https://api.github.com/repos/rook/rook/subscribers","subscription_url":"https://api.github.com/repos/rook/rook/subscription","commits_url":"https://api.github.com/repos/rook/rook/commits{/sha}","git_commits_url":"https://api.github.com/repos/rook/rook/git/commits{/sha}","comments_url":"https://api.github.com/repos/rook/rook/comments{/number}","issue_comment_url":"https://api.github.com/repos/rook/rook/issues/comments{/number}","contents_url":"https://api.github.com/repos/rook/rook/contents/{+path}","compare_url":"https://api.github.com/repos/rook/rook/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rook/rook/merges","archive_url":"https://api.github.com/repos/rook/rook/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rook/rook/downloads","issues_url":"https://api.github.com/repos/rook/rook/issues{/number}","pulls_url":"https://api.github.com/repos/rook/rook/pulls{/number}","milestones_url":"https://api.github.com/repos/rook/rook/milestones{/number}","notifications_url":"https://api.github.com/repos/rook/rook/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rook/rook/labels{/name}","releases_url":"https://api.github.com/repos/rook/rook/releases{/id}","deployments_url":"https://api.github.com/repos/rook/rook/deployments","created_at":"2016-07-08T22:45:05Z","updated_at":"2017-02-07T02:37:47Z","pushed_at":"2017-02-07T15:41:42Z","git_url":"git://github.com/rook/rook.git","ssh_url":"git@github.com:rook/rook.git","clone_url":"https://github.com/rook/rook.git","svn_url":"https://github.com/rook/rook","homepage":"https://rook.io","size":1186,"stargazers_count":772,"watchers_count":772,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":29,"mirror_url":null,"open_issues_count":101,"forks":29,"open_issues":101,"watchers":772,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rook/rook/pulls/369"},"html":{"href":"https://github.com/rook/rook/pull/369"},"issue":{"href":"https://api.github.com/repos/rook/rook/issues/369"},"comments":{"href":"https://api.github.com/repos/rook/rook/issues/369/comments"},"review_comments":{"href":"https://api.github.com/repos/rook/rook/pulls/369/comments"},"review_comment":{"href":"https://api.github.com/repos/rook/rook/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rook/rook/pulls/369/commits"},"statuses":{"href":"https://api.github.com/repos/rook/rook/statuses/bfa30b00129dfd28c154f3c7a497f3daf7c77b67"}}}}
{"actor":{"display_login":"travisn"}}