{"action":"created","comment":{"url":"https://api.github.com/repos/ceph/ceph/pulls/comments/176147751","pull_request_review_id":105800321,"id":176147751,"diff_hunk":"@@ -47,3 +49,40 @@ def list(self, attrs=None, stats=False):\n     def get(self, pool_name, attrs=None, stats=False):\n         pools = self.list(attrs, stats)\n         return [pool for pool in pools if pool['pool_name'] == pool_name][0]\n+\n+    # pylint: disable=too-many-arguments, too-many-locals\n+    @RESTController.args_from_json\n+    def create(self, pool, pg_num, pool_type, erasure_code_profile=None, cache_mode=None,\n+               tier_of=None, read_tier=None, flags=None, compression_required_ratio=None,\n+               application_metadata=None, crush_rule=None, rule_name=None, **kwargs):\n+        ecp = erasure_code_profile if erasure_code_profile else None\n+        CephService.send_command('mon', 'osd pool create', pool=pool, pg_num=int(pg_num),\n+                                 pgp_num=int(pg_num), pool_type=pool_type, erasure_code_profile=ecp)\n+\n+        if cache_mode:\n+            CephService.send_command('mon', 'osd tier cache-mode', pool=pool, mode=cache_mode)\n+        if tier_of:\n+            CephService.send_command('mon', 'osd tier add', tierpool=tier_of, pool=pool)\n+        if read_tier:\n+            CephService.send_command('mon', 'osd tier set-overlay', pool=pool,\n+                                     overlaypool=read_tier)\n+        if flags and 'ec_overwrites' in flags:\n+            CephService.send_command('mon', 'osd pool set', pool=pool, var='allow_ec_overwrites',\n+                                     val='true')\n+        if compression_required_ratio:\n+            CephService.send_command('mon', 'osd pool set', pool=pool,\n+                                     var='compression_required_ratio',\n+                                     val=str(compression_required_ratio))\n+        if application_metadata:\n+            for app in set(json.loads(application_metadata)):\n+                CephService.send_command('mon', 'osd pool application enable', pool=pool, app=app)\n+        if crush_rule:\n+            CephService.send_command('mon', 'osd pool set', pool=pool, var='crush_rule',\n+                                     val=rule_name)\n+        for key, value in kwargs.items():\n+            if type == 'replicated' and key not in \\\n+                    ['name', 'erasure_code_profile_id'] and value is not None:\n+                CephService.send_command('mon', 'osd pool set', pool=pool, var=key, val=value)\n+            elif self.type == 'erasure' and key not in ['name', 'size', 'min_size'] \\","path":"src/pybind/mgr/dashboard_v2/controllers/pool.py","position":null,"original_position":47,"commit_id":"a5910d0af64101421c5b55de9d429b37de8e7b42","original_commit_id":"6a1ee3992f10f556f55a77f669e5eb1996df1ef1","user":{"login":"sebastian-philipp","id":2574405,"avatar_url":"https://avatars2.githubusercontent.com/u/2574405?v=4","gravatar_id":"","url":"https://api.github.com/users/sebastian-philipp","html_url":"https://github.com/sebastian-philipp","followers_url":"https://api.github.com/users/sebastian-philipp/followers","following_url":"https://api.github.com/users/sebastian-philipp/following{/other_user}","gists_url":"https://api.github.com/users/sebastian-philipp/gists{/gist_id}","starred_url":"https://api.github.com/users/sebastian-philipp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebastian-philipp/subscriptions","organizations_url":"https://api.github.com/users/sebastian-philipp/orgs","repos_url":"https://api.github.com/users/sebastian-philipp/repos","events_url":"https://api.github.com/users/sebastian-philipp/events{/privacy}","received_events_url":"https://api.github.com/users/sebastian-philipp/received_events","type":"User","site_admin":false},"body":"fixed.","created_at":"2018-03-21T16:26:13Z","updated_at":"2018-03-21T16:26:13Z","html_url":"https://github.com/ceph/ceph/pull/20865#discussion_r176147751","pull_request_url":"https://api.github.com/repos/ceph/ceph/pulls/20865","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/ceph/ceph/pulls/comments/176147751"},"html":{"href":"https://github.com/ceph/ceph/pull/20865#discussion_r176147751"},"pull_request":{"href":"https://api.github.com/repos/ceph/ceph/pulls/20865"}},"in_reply_to_id":175017520},"pull_request":{"url":"https://api.github.com/repos/ceph/ceph/pulls/20865","id":174630107,"html_url":"https://github.com/ceph/ceph/pull/20865","diff_url":"https://github.com/ceph/ceph/pull/20865.diff","patch_url":"https://github.com/ceph/ceph/pull/20865.patch","issue_url":"https://api.github.com/repos/ceph/ceph/issues/20865","number":20865,"state":"open","locked":false,"title":"[WIP] mgr/dashboard: Add Pool-create to the backend","user":{"login":"sebastian-philipp","id":2574405,"avatar_url":"https://avatars2.githubusercontent.com/u/2574405?v=4","gravatar_id":"","url":"https://api.github.com/users/sebastian-philipp","html_url":"https://github.com/sebastian-philipp","followers_url":"https://api.github.com/users/sebastian-philipp/followers","following_url":"https://api.github.com/users/sebastian-philipp/following{/other_user}","gists_url":"https://api.github.com/users/sebastian-philipp/gists{/gist_id}","starred_url":"https://api.github.com/users/sebastian-philipp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebastian-philipp/subscriptions","organizations_url":"https://api.github.com/users/sebastian-philipp/orgs","repos_url":"https://api.github.com/users/sebastian-philipp/repos","events_url":"https://api.github.com/users/sebastian-philipp/events{/privacy}","received_events_url":"https://api.github.com/users/sebastian-philipp/received_events","type":"User","site_admin":false},"body":"~~**Requires** #20863~~\r\n\r\nLocal testing is affected by http://tracker.ceph.com/issues/23345\r\n\r\nAlso:\r\n\r\n* Add API test\r\n* Fixed  `@RESTController.args_from_json`\r\n* Refactor `send_command` into single method  …\r\n* Minor tweak to `DashboardTestCase._request`\r\n","created_at":"2018-03-13T11:27:11Z","updated_at":"2018-03-21T16:26:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"03e0b23bde69842985839a9d7f88e0088ae56b2d","assignee":null,"assignees":[],"requested_reviewers":[{"login":"votdev","id":1897962,"avatar_url":"https://avatars3.githubusercontent.com/u/1897962?v=4","gravatar_id":"","url":"https://api.github.com/users/votdev","html_url":"https://github.com/votdev","followers_url":"https://api.github.com/users/votdev/followers","following_url":"https://api.github.com/users/votdev/following{/other_user}","gists_url":"https://api.github.com/users/votdev/gists{/gist_id}","starred_url":"https://api.github.com/users/votdev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/votdev/subscriptions","organizations_url":"https://api.github.com/users/votdev/orgs","repos_url":"https://api.github.com/users/votdev/repos","events_url":"https://api.github.com/users/votdev/events{/privacy}","received_events_url":"https://api.github.com/users/votdev/received_events","type":"User","site_admin":false},{"login":"p-na","id":9606095,"avatar_url":"https://avatars2.githubusercontent.com/u/9606095?v=4","gravatar_id":"","url":"https://api.github.com/users/p-na","html_url":"https://github.com/p-na","followers_url":"https://api.github.com/users/p-na/followers","following_url":"https://api.github.com/users/p-na/following{/other_user}","gists_url":"https://api.github.com/users/p-na/gists{/gist_id}","starred_url":"https://api.github.com/users/p-na/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/p-na/subscriptions","organizations_url":"https://api.github.com/users/p-na/orgs","repos_url":"https://api.github.com/users/p-na/repos","events_url":"https://api.github.com/users/p-na/events{/privacy}","received_events_url":"https://api.github.com/users/p-na/received_events","type":"User","site_admin":false},{"login":"Devp00l","id":16167865,"avatar_url":"https://avatars3.githubusercontent.com/u/16167865?v=4","gravatar_id":"","url":"https://api.github.com/users/Devp00l","html_url":"https://github.com/Devp00l","followers_url":"https://api.github.com/users/Devp00l/followers","following_url":"https://api.github.com/users/Devp00l/following{/other_user}","gists_url":"https://api.github.com/users/Devp00l/gists{/gist_id}","starred_url":"https://api.github.com/users/Devp00l/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Devp00l/subscriptions","organizations_url":"https://api.github.com/users/Devp00l/orgs","repos_url":"https://api.github.com/users/Devp00l/repos","events_url":"https://api.github.com/users/Devp00l/events{/privacy}","received_events_url":"https://api.github.com/users/Devp00l/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":647438941,"url":"https://api.github.com/repos/ceph/ceph/labels/DNM","name":"DNM","color":"ff0000","default":false},{"id":850326757,"url":"https://api.github.com/repos/ceph/ceph/labels/dashboard","name":"dashboard","color":"68a2c1","default":false},{"id":134774006,"url":"https://api.github.com/repos/ceph/ceph/labels/feature","name":"feature","color":"00ff24","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ceph/ceph/pulls/20865/commits","review_comments_url":"https://api.github.com/repos/ceph/ceph/pulls/20865/comments","review_comment_url":"https://api.github.com/repos/ceph/ceph/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ceph/ceph/issues/20865/comments","statuses_url":"https://api.github.com/repos/ceph/ceph/statuses/a5910d0af64101421c5b55de9d429b37de8e7b42","head":{"label":"sebastian-philipp:dashboard_v2_pool-create","ref":"dashboard_v2_pool-create","sha":"a5910d0af64101421c5b55de9d429b37de8e7b42","user":{"login":"sebastian-philipp","id":2574405,"avatar_url":"https://avatars2.githubusercontent.com/u/2574405?v=4","gravatar_id":"","url":"https://api.github.com/users/sebastian-philipp","html_url":"https://github.com/sebastian-philipp","followers_url":"https://api.github.com/users/sebastian-philipp/followers","following_url":"https://api.github.com/users/sebastian-philipp/following{/other_user}","gists_url":"https://api.github.com/users/sebastian-philipp/gists{/gist_id}","starred_url":"https://api.github.com/users/sebastian-philipp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebastian-philipp/subscriptions","organizations_url":"https://api.github.com/users/sebastian-philipp/orgs","repos_url":"https://api.github.com/users/sebastian-philipp/repos","events_url":"https://api.github.com/users/sebastian-philipp/events{/privacy}","received_events_url":"https://api.github.com/users/sebastian-philipp/received_events","type":"User","site_admin":false},"repo":{"id":96899744,"name":"ceph","full_name":"sebastian-philipp/ceph","owner":{"login":"sebastian-philipp","id":2574405,"avatar_url":"https://avatars2.githubusercontent.com/u/2574405?v=4","gravatar_id":"","url":"https://api.github.com/users/sebastian-philipp","html_url":"https://github.com/sebastian-philipp","followers_url":"https://api.github.com/users/sebastian-philipp/followers","following_url":"https://api.github.com/users/sebastian-philipp/following{/other_user}","gists_url":"https://api.github.com/users/sebastian-philipp/gists{/gist_id}","starred_url":"https://api.github.com/users/sebastian-philipp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebastian-philipp/subscriptions","organizations_url":"https://api.github.com/users/sebastian-philipp/orgs","repos_url":"https://api.github.com/users/sebastian-philipp/repos","events_url":"https://api.github.com/users/sebastian-philipp/events{/privacy}","received_events_url":"https://api.github.com/users/sebastian-philipp/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sebastian-philipp/ceph","description":"Ceph is a distributed object, block, and file storage platform ","fork":true,"url":"https://api.github.com/repos/sebastian-philipp/ceph","forks_url":"https://api.github.com/repos/sebastian-philipp/ceph/forks","keys_url":"https://api.github.com/repos/sebastian-philipp/ceph/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sebastian-philipp/ceph/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sebastian-philipp/ceph/teams","hooks_url":"https://api.github.com/repos/sebastian-philipp/ceph/hooks","issue_events_url":"https://api.github.com/repos/sebastian-philipp/ceph/issues/events{/number}","events_url":"https://api.github.com/repos/sebastian-philipp/ceph/events","assignees_url":"https://api.github.com/repos/sebastian-philipp/ceph/assignees{/user}","branches_url":"https://api.github.com/repos/sebastian-philipp/ceph/branches{/branch}","tags_url":"https://api.github.com/repos/sebastian-philipp/ceph/tags","blobs_url":"https://api.github.com/repos/sebastian-philipp/ceph/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sebastian-philipp/ceph/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sebastian-philipp/ceph/git/refs{/sha}","trees_url":"https://api.github.com/repos/sebastian-philipp/ceph/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sebastian-philipp/ceph/statuses/{sha}","languages_url":"https://api.github.com/repos/sebastian-philipp/ceph/languages","stargazers_url":"https://api.github.com/repos/sebastian-philipp/ceph/stargazers","contributors_url":"https://api.github.com/repos/sebastian-philipp/ceph/contributors","subscribers_url":"https://api.github.com/repos/sebastian-philipp/ceph/subscribers","subscription_url":"https://api.github.com/repos/sebastian-philipp/ceph/subscription","commits_url":"https://api.github.com/repos/sebastian-philipp/ceph/commits{/sha}","git_commits_url":"https://api.github.com/repos/sebastian-philipp/ceph/git/commits{/sha}","comments_url":"https://api.github.com/repos/sebastian-philipp/ceph/comments{/number}","issue_comment_url":"https://api.github.com/repos/sebastian-philipp/ceph/issues/comments{/number}","contents_url":"https://api.github.com/repos/sebastian-philipp/ceph/contents/{+path}","compare_url":"https://api.github.com/repos/sebastian-philipp/ceph/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sebastian-philipp/ceph/merges","archive_url":"https://api.github.com/repos/sebastian-philipp/ceph/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sebastian-philipp/ceph/downloads","issues_url":"https://api.github.com/repos/sebastian-philipp/ceph/issues{/number}","pulls_url":"https://api.github.com/repos/sebastian-philipp/ceph/pulls{/number}","milestones_url":"https://api.github.com/repos/sebastian-philipp/ceph/milestones{/number}","notifications_url":"https://api.github.com/repos/sebastian-philipp/ceph/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sebastian-philipp/ceph/labels{/name}","releases_url":"https://api.github.com/repos/sebastian-philipp/ceph/releases{/id}","deployments_url":"https://api.github.com/repos/sebastian-philipp/ceph/deployments","created_at":"2017-07-11T14:02:08Z","updated_at":"2018-03-16T15:07:41Z","pushed_at":"2018-03-21T16:24:43Z","git_url":"git://github.com/sebastian-philipp/ceph.git","ssh_url":"git@github.com:sebastian-philipp/ceph.git","clone_url":"https://github.com/sebastian-philipp/ceph.git","svn_url":"https://github.com/sebastian-philipp/ceph","homepage":"http://ceph.com","size":266376,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ceph:master","ref":"master","sha":"ac98cfd71380f591ca8da37cc785722ce073060a","user":{"login":"ceph","id":1015767,"avatar_url":"https://avatars3.githubusercontent.com/u/1015767?v=4","gravatar_id":"","url":"https://api.github.com/users/ceph","html_url":"https://github.com/ceph","followers_url":"https://api.github.com/users/ceph/followers","following_url":"https://api.github.com/users/ceph/following{/other_user}","gists_url":"https://api.github.com/users/ceph/gists{/gist_id}","starred_url":"https://api.github.com/users/ceph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ceph/subscriptions","organizations_url":"https://api.github.com/users/ceph/orgs","repos_url":"https://api.github.com/users/ceph/repos","events_url":"https://api.github.com/users/ceph/events{/privacy}","received_events_url":"https://api.github.com/users/ceph/received_events","type":"Organization","site_admin":false},"repo":{"id":2310495,"name":"ceph","full_name":"ceph/ceph","owner":{"login":"ceph","id":1015767,"avatar_url":"https://avatars3.githubusercontent.com/u/1015767?v=4","gravatar_id":"","url":"https://api.github.com/users/ceph","html_url":"https://github.com/ceph","followers_url":"https://api.github.com/users/ceph/followers","following_url":"https://api.github.com/users/ceph/following{/other_user}","gists_url":"https://api.github.com/users/ceph/gists{/gist_id}","starred_url":"https://api.github.com/users/ceph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ceph/subscriptions","organizations_url":"https://api.github.com/users/ceph/orgs","repos_url":"https://api.github.com/users/ceph/repos","events_url":"https://api.github.com/users/ceph/events{/privacy}","received_events_url":"https://api.github.com/users/ceph/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ceph/ceph","description":"Ceph is a distributed object, block, and file storage platform ","fork":false,"url":"https://api.github.com/repos/ceph/ceph","forks_url":"https://api.github.com/repos/ceph/ceph/forks","keys_url":"https://api.github.com/repos/ceph/ceph/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ceph/ceph/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ceph/ceph/teams","hooks_url":"https://api.github.com/repos/ceph/ceph/hooks","issue_events_url":"https://api.github.com/repos/ceph/ceph/issues/events{/number}","events_url":"https://api.github.com/repos/ceph/ceph/events","assignees_url":"https://api.github.com/repos/ceph/ceph/assignees{/user}","branches_url":"https://api.github.com/repos/ceph/ceph/branches{/branch}","tags_url":"https://api.github.com/repos/ceph/ceph/tags","blobs_url":"https://api.github.com/repos/ceph/ceph/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ceph/ceph/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ceph/ceph/git/refs{/sha}","trees_url":"https://api.github.com/repos/ceph/ceph/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ceph/ceph/statuses/{sha}","languages_url":"https://api.github.com/repos/ceph/ceph/languages","stargazers_url":"https://api.github.com/repos/ceph/ceph/stargazers","contributors_url":"https://api.github.com/repos/ceph/ceph/contributors","subscribers_url":"https://api.github.com/repos/ceph/ceph/subscribers","subscription_url":"https://api.github.com/repos/ceph/ceph/subscription","commits_url":"https://api.github.com/repos/ceph/ceph/commits{/sha}","git_commits_url":"https://api.github.com/repos/ceph/ceph/git/commits{/sha}","comments_url":"https://api.github.com/repos/ceph/ceph/comments{/number}","issue_comment_url":"https://api.github.com/repos/ceph/ceph/issues/comments{/number}","contents_url":"https://api.github.com/repos/ceph/ceph/contents/{+path}","compare_url":"https://api.github.com/repos/ceph/ceph/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ceph/ceph/merges","archive_url":"https://api.github.com/repos/ceph/ceph/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ceph/ceph/downloads","issues_url":"https://api.github.com/repos/ceph/ceph/issues{/number}","pulls_url":"https://api.github.com/repos/ceph/ceph/pulls{/number}","milestones_url":"https://api.github.com/repos/ceph/ceph/milestones{/number}","notifications_url":"https://api.github.com/repos/ceph/ceph/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ceph/ceph/labels{/name}","releases_url":"https://api.github.com/repos/ceph/ceph/releases{/id}","deployments_url":"https://api.github.com/repos/ceph/ceph/deployments","created_at":"2011-09-01T21:41:26Z","updated_at":"2018-03-21T15:44:41Z","pushed_at":"2018-03-21T16:24:45Z","git_url":"git://github.com/ceph/ceph.git","ssh_url":"git@github.com:ceph/ceph.git","clone_url":"https://github.com/ceph/ceph.git","svn_url":"https://github.com/ceph/ceph","homepage":"http://ceph.com","size":274133,"stargazers_count":4231,"watchers_count":4231,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2356,"mirror_url":null,"archived":false,"open_issues_count":716,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":2356,"open_issues":716,"watchers":4231,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ceph/ceph/pulls/20865"},"html":{"href":"https://github.com/ceph/ceph/pull/20865"},"issue":{"href":"https://api.github.com/repos/ceph/ceph/issues/20865"},"comments":{"href":"https://api.github.com/repos/ceph/ceph/issues/20865/comments"},"review_comments":{"href":"https://api.github.com/repos/ceph/ceph/pulls/20865/comments"},"review_comment":{"href":"https://api.github.com/repos/ceph/ceph/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ceph/ceph/pulls/20865/commits"},"statuses":{"href":"https://api.github.com/repos/ceph/ceph/statuses/a5910d0af64101421c5b55de9d429b37de8e7b42"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"sebastian-philipp"}}