{"action":"created","comment":{"url":"https://api.github.com/repos/ceph/ceph/pulls/comments/177402583","pull_request_review_id":107264296,"id":177402583,"diff_hunk":"@@ -508,3 +508,171 @@ The settings management implementation will make sure that if you change a\n setting value from the Python code you will see that change when accessing\n that setting from the CLI and vice-versa.\n \n+\n+How to run a controller read-write operation asynchronously?\n+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n+\n+Some controllers might need to execute operations that alter the state of the\n+Ceph cluster. These operations might take some time to execute and to maintain\n+a good user experience in the Web UI, we need to run those operations\n+asynchronously and return immediatly to frontend some information that the\n+operations are running in the background.\n+\n+To help in the development of the above scenario we added the support for\n+asynchronous tasks. To trigger the execution of an asynchronous task we must\n+use the following class method of the ``TaskManager`` class::\n+\n+  from ..tools import TaskManager\n+  # ...\n+  TaskManager.run(namespace, metadata, func, args, kwargs)\n+\n+* ``namespace`` is a string that can be used to group tasks. For instance","path":"src/pybind/mgr/dashboard/HACKING.rst","position":22,"original_position":22,"commit_id":"f387e7b14a33269f6d63242ecdc17f10c1c26cbb","original_commit_id":"2801f2514cc98a89fad883aa2d6fd03b0087841c","user":{"login":"jcsp","id":944640,"avatar_url":"https://avatars3.githubusercontent.com/u/944640?v=4","gravatar_id":"","url":"https://api.github.com/users/jcsp","html_url":"https://github.com/jcsp","followers_url":"https://api.github.com/users/jcsp/followers","following_url":"https://api.github.com/users/jcsp/following{/other_user}","gists_url":"https://api.github.com/users/jcsp/gists{/gist_id}","starred_url":"https://api.github.com/users/jcsp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcsp/subscriptions","organizations_url":"https://api.github.com/users/jcsp/orgs","repos_url":"https://api.github.com/users/jcsp/repos","events_url":"https://api.github.com/users/jcsp/events{/privacy}","received_events_url":"https://api.github.com/users/jcsp/received_events","type":"User","site_admin":false},"body":"`name` sounds good to me (sorry for delay responding)","created_at":"2018-03-27T12:19:16Z","updated_at":"2018-03-27T12:19:16Z","html_url":"https://github.com/ceph/ceph/pull/20870#discussion_r177402583","pull_request_url":"https://api.github.com/repos/ceph/ceph/pulls/20870","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/ceph/ceph/pulls/comments/177402583"},"html":{"href":"https://github.com/ceph/ceph/pull/20870#discussion_r177402583"},"pull_request":{"href":"https://api.github.com/repos/ceph/ceph/pulls/20870"}},"in_reply_to_id":175257553},"pull_request":{"url":"https://api.github.com/repos/ceph/ceph/pulls/20870","id":174678329,"html_url":"https://github.com/ceph/ceph/pull/20870","diff_url":"https://github.com/ceph/ceph/pull/20870.diff","patch_url":"https://github.com/ceph/ceph/pull/20870.patch","issue_url":"https://api.github.com/repos/ceph/ceph/issues/20870","number":20870,"state":"open","locked":false,"title":"mgr/dashboard: asynchronous task support","user":{"login":"rjfd","id":17119885,"avatar_url":"https://avatars0.githubusercontent.com/u/17119885?v=4","gravatar_id":"","url":"https://api.github.com/users/rjfd","html_url":"https://github.com/rjfd","followers_url":"https://api.github.com/users/rjfd/followers","following_url":"https://api.github.com/users/rjfd/following{/other_user}","gists_url":"https://api.github.com/users/rjfd/gists{/gist_id}","starred_url":"https://api.github.com/users/rjfd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rjfd/subscriptions","organizations_url":"https://api.github.com/users/rjfd/orgs","repos_url":"https://api.github.com/users/rjfd/repos","events_url":"https://api.github.com/users/rjfd/events{/privacy}","received_events_url":"https://api.github.com/users/rjfd/received_events","type":"User","site_admin":false},"body":"This PR introduces the support for executing long-running tasks by dashboard backend controllers.\r\nThe tasks are executed asynchronously and can be queried for their respecting executing status.\r\n\r\nFor detailed information please read the changes made to `HACKING.rst` file.\r\n\r\nSigned-off-by: Ricardo Dias <rdias@suse.com>","created_at":"2018-03-13T14:31:45Z","updated_at":"2018-03-27T12:19:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"10894e71309e726d303a3c8abe1ee2cf6fea612f","assignee":null,"assignees":[],"requested_reviewers":[{"login":"LenzGr","id":263427,"avatar_url":"https://avatars3.githubusercontent.com/u/263427?v=4","gravatar_id":"","url":"https://api.github.com/users/LenzGr","html_url":"https://github.com/LenzGr","followers_url":"https://api.github.com/users/LenzGr/followers","following_url":"https://api.github.com/users/LenzGr/following{/other_user}","gists_url":"https://api.github.com/users/LenzGr/gists{/gist_id}","starred_url":"https://api.github.com/users/LenzGr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LenzGr/subscriptions","organizations_url":"https://api.github.com/users/LenzGr/orgs","repos_url":"https://api.github.com/users/LenzGr/repos","events_url":"https://api.github.com/users/LenzGr/events{/privacy}","received_events_url":"https://api.github.com/users/LenzGr/received_events","type":"User","site_admin":false},{"login":"s0nea","id":8761082,"avatar_url":"https://avatars2.githubusercontent.com/u/8761082?v=4","gravatar_id":"","url":"https://api.github.com/users/s0nea","html_url":"https://github.com/s0nea","followers_url":"https://api.github.com/users/s0nea/followers","following_url":"https://api.github.com/users/s0nea/following{/other_user}","gists_url":"https://api.github.com/users/s0nea/gists{/gist_id}","starred_url":"https://api.github.com/users/s0nea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/s0nea/subscriptions","organizations_url":"https://api.github.com/users/s0nea/orgs","repos_url":"https://api.github.com/users/s0nea/repos","events_url":"https://api.github.com/users/s0nea/events{/privacy}","received_events_url":"https://api.github.com/users/s0nea/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}],"requested_teams":[],"labels":[{"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},{"id":454906768,"url":"https://api.github.com/repos/ceph/ceph/labels/mgr","name":"mgr","color":"c2e0c6","default":false},{"id":148431321,"url":"https://api.github.com/repos/ceph/ceph/labels/needs-qa","name":"needs-qa","color":"fad8c7","default":false},{"id":440630784,"url":"https://api.github.com/repos/ceph/ceph/labels/wip-rdias-testing","name":"wip-rdias-testing","color":"fef2c0","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ceph/ceph/pulls/20870/commits","review_comments_url":"https://api.github.com/repos/ceph/ceph/pulls/20870/comments","review_comment_url":"https://api.github.com/repos/ceph/ceph/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ceph/ceph/issues/20870/comments","statuses_url":"https://api.github.com/repos/ceph/ceph/statuses/f387e7b14a33269f6d63242ecdc17f10c1c26cbb","head":{"label":"rjfd:wip-dashboard-tasks","ref":"wip-dashboard-tasks","sha":"f387e7b14a33269f6d63242ecdc17f10c1c26cbb","user":{"login":"rjfd","id":17119885,"avatar_url":"https://avatars0.githubusercontent.com/u/17119885?v=4","gravatar_id":"","url":"https://api.github.com/users/rjfd","html_url":"https://github.com/rjfd","followers_url":"https://api.github.com/users/rjfd/followers","following_url":"https://api.github.com/users/rjfd/following{/other_user}","gists_url":"https://api.github.com/users/rjfd/gists{/gist_id}","starred_url":"https://api.github.com/users/rjfd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rjfd/subscriptions","organizations_url":"https://api.github.com/users/rjfd/orgs","repos_url":"https://api.github.com/users/rjfd/repos","events_url":"https://api.github.com/users/rjfd/events{/privacy}","received_events_url":"https://api.github.com/users/rjfd/received_events","type":"User","site_admin":false},"repo":{"id":51286925,"name":"ceph","full_name":"rjfd/ceph","owner":{"login":"rjfd","id":17119885,"avatar_url":"https://avatars0.githubusercontent.com/u/17119885?v=4","gravatar_id":"","url":"https://api.github.com/users/rjfd","html_url":"https://github.com/rjfd","followers_url":"https://api.github.com/users/rjfd/followers","following_url":"https://api.github.com/users/rjfd/following{/other_user}","gists_url":"https://api.github.com/users/rjfd/gists{/gist_id}","starred_url":"https://api.github.com/users/rjfd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rjfd/subscriptions","organizations_url":"https://api.github.com/users/rjfd/orgs","repos_url":"https://api.github.com/users/rjfd/repos","events_url":"https://api.github.com/users/rjfd/events{/privacy}","received_events_url":"https://api.github.com/users/rjfd/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rjfd/ceph","description":"Ceph is a distributed object, block, and file storage platform ","fork":true,"url":"https://api.github.com/repos/rjfd/ceph","forks_url":"https://api.github.com/repos/rjfd/ceph/forks","keys_url":"https://api.github.com/repos/rjfd/ceph/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rjfd/ceph/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rjfd/ceph/teams","hooks_url":"https://api.github.com/repos/rjfd/ceph/hooks","issue_events_url":"https://api.github.com/repos/rjfd/ceph/issues/events{/number}","events_url":"https://api.github.com/repos/rjfd/ceph/events","assignees_url":"https://api.github.com/repos/rjfd/ceph/assignees{/user}","branches_url":"https://api.github.com/repos/rjfd/ceph/branches{/branch}","tags_url":"https://api.github.com/repos/rjfd/ceph/tags","blobs_url":"https://api.github.com/repos/rjfd/ceph/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rjfd/ceph/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rjfd/ceph/git/refs{/sha}","trees_url":"https://api.github.com/repos/rjfd/ceph/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rjfd/ceph/statuses/{sha}","languages_url":"https://api.github.com/repos/rjfd/ceph/languages","stargazers_url":"https://api.github.com/repos/rjfd/ceph/stargazers","contributors_url":"https://api.github.com/repos/rjfd/ceph/contributors","subscribers_url":"https://api.github.com/repos/rjfd/ceph/subscribers","subscription_url":"https://api.github.com/repos/rjfd/ceph/subscription","commits_url":"https://api.github.com/repos/rjfd/ceph/commits{/sha}","git_commits_url":"https://api.github.com/repos/rjfd/ceph/git/commits{/sha}","comments_url":"https://api.github.com/repos/rjfd/ceph/comments{/number}","issue_comment_url":"https://api.github.com/repos/rjfd/ceph/issues/comments{/number}","contents_url":"https://api.github.com/repos/rjfd/ceph/contents/{+path}","compare_url":"https://api.github.com/repos/rjfd/ceph/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rjfd/ceph/merges","archive_url":"https://api.github.com/repos/rjfd/ceph/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rjfd/ceph/downloads","issues_url":"https://api.github.com/repos/rjfd/ceph/issues{/number}","pulls_url":"https://api.github.com/repos/rjfd/ceph/pulls{/number}","milestones_url":"https://api.github.com/repos/rjfd/ceph/milestones{/number}","notifications_url":"https://api.github.com/repos/rjfd/ceph/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rjfd/ceph/labels{/name}","releases_url":"https://api.github.com/repos/rjfd/ceph/releases{/id}","deployments_url":"https://api.github.com/repos/rjfd/ceph/deployments","created_at":"2016-02-08T08:44:21Z","updated_at":"2018-03-19T08:00:51Z","pushed_at":"2018-03-26T14:56:25Z","git_url":"git://github.com/rjfd/ceph.git","ssh_url":"git@github.com:rjfd/ceph.git","clone_url":"https://github.com/rjfd/ceph.git","svn_url":"https://github.com/rjfd/ceph","homepage":"http://ceph.com","size":358904,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"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":"84ef01e3e0e6513ed7c25259ddca9f7de18e7526","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-27T11:08:07Z","pushed_at":"2018-03-27T12:02: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":274567,"stargazers_count":4268,"watchers_count":4268,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2367,"mirror_url":null,"archived":false,"open_issues_count":728,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":2367,"open_issues":728,"watchers":4268,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ceph/ceph/pulls/20870"},"html":{"href":"https://github.com/ceph/ceph/pull/20870"},"issue":{"href":"https://api.github.com/repos/ceph/ceph/issues/20870"},"comments":{"href":"https://api.github.com/repos/ceph/ceph/issues/20870/comments"},"review_comments":{"href":"https://api.github.com/repos/ceph/ceph/pulls/20870/comments"},"review_comment":{"href":"https://api.github.com/repos/ceph/ceph/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ceph/ceph/pulls/20870/commits"},"statuses":{"href":"https://api.github.com/repos/ceph/ceph/statuses/f387e7b14a33269f6d63242ecdc17f10c1c26cbb"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"jcsp"}}