{"action":"created","comment":{"url":"https://api.github.com/repos/jupyter/tmpnb/pulls/comments/41612403","id":41612403,"diff_hunk":"@@ -156,6 +169,47 @@ def post(self):\n     def pool(self):\n         return self.settings['pool']\n \n+class APIPoolHandler(BaseHandler):\n+    #@web.authenticated\n+    @gen.coroutine\n+    def post(self):\n+        '''Allow updating pool configuration remotely'''\n+        # TODO: Auth\n+        # TODO: Determine payload format\n+        model = self.get_json_body()\n+        if model is None:\n+            return self.write({'error': 'empty payload'})\n+\n+        if 'pool' in model and 'capacity' in model['pool']:\n+            new_capacity = int(model['pool']['capacity'])\n+            self.pool.capacity = new_capacity\n+            yield self.pool.heartbeat()\n+\n+        diagnosis = self.pool.diagnosis()\n+        yield diagnosis.observe()\n+        routes = yield diagnosis._proxy_routes()\n+\n+        diagnosisDict = dict(","path":"orchestrate.py","position":60,"original_position":60,"commit_id":"ebf845e2e21264b63f41f3378f077e1f36480fe0","original_commit_id":"ebf845e2e21264b63f41f3378f077e1f36480fe0","user":{"login":"minrk","id":151929,"avatar_url":"https://avatars.githubusercontent.com/u/151929?v=3","gravatar_id":"","url":"https://api.github.com/users/minrk","html_url":"https://github.com/minrk","followers_url":"https://api.github.com/users/minrk/followers","following_url":"https://api.github.com/users/minrk/following{/other_user}","gists_url":"https://api.github.com/users/minrk/gists{/gist_id}","starred_url":"https://api.github.com/users/minrk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minrk/subscriptions","organizations_url":"https://api.github.com/users/minrk/orgs","repos_url":"https://api.github.com/users/minrk/repos","events_url":"https://api.github.com/users/minrk/events{/privacy}","received_events_url":"https://api.github.com/users/minrk/received_events","type":"User","site_admin":false},"body":"s/methinks/meThinks/","created_at":"2015-10-09T09:28:13Z","updated_at":"2015-10-09T09:28:13Z","html_url":"https://github.com/jupyter/tmpnb/pull/178#discussion_r41612403","pull_request_url":"https://api.github.com/repos/jupyter/tmpnb/pulls/178","_links":{"self":{"href":"https://api.github.com/repos/jupyter/tmpnb/pulls/comments/41612403"},"html":{"href":"https://github.com/jupyter/tmpnb/pull/178#discussion_r41612403"},"pull_request":{"href":"https://api.github.com/repos/jupyter/tmpnb/pulls/178"}}},"pull_request":{"url":"https://api.github.com/repos/jupyter/tmpnb/pulls/178","id":47107011,"html_url":"https://github.com/jupyter/tmpnb/pull/178","diff_url":"https://github.com/jupyter/tmpnb/pull/178.diff","patch_url":"https://github.com/jupyter/tmpnb/pull/178.patch","issue_url":"https://api.github.com/repos/jupyter/tmpnb/issues/178","number":178,"state":"open","locked":false,"title":"[WIP] Expanding pool","user":{"login":"rgbkrk","id":836375,"avatar_url":"https://avatars.githubusercontent.com/u/836375?v=3","gravatar_id":"","url":"https://api.github.com/users/rgbkrk","html_url":"https://github.com/rgbkrk","followers_url":"https://api.github.com/users/rgbkrk/followers","following_url":"https://api.github.com/users/rgbkrk/following{/other_user}","gists_url":"https://api.github.com/users/rgbkrk/gists{/gist_id}","starred_url":"https://api.github.com/users/rgbkrk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rgbkrk/subscriptions","organizations_url":"https://api.github.com/users/rgbkrk/orgs","repos_url":"https://api.github.com/users/rgbkrk/repos","events_url":"https://api.github.com/users/rgbkrk/events{/privacy}","received_events_url":"https://api.github.com/users/rgbkrk/received_events","type":"User","site_admin":false},"body":"This adds an endpoint for expanding a pool size. Needs auth, I've stubbed it out for now.\r\n\r\nIn addition, this includes culling dangling containers within the heartbeat: containers which are neither routed nor in the pool. We have to assume they should be deleted since they're certainly not reachable by users but we also have no idea if another user has touched it. I may open this up in a separate PR.","created_at":"2015-10-08T03:04:46Z","updated_at":"2015-10-09T09:28:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2a11e1469e3d4f5e2a39e7b01fda2eebcfee96d1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jupyter/tmpnb/pulls/178/commits","review_comments_url":"https://api.github.com/repos/jupyter/tmpnb/pulls/178/comments","review_comment_url":"https://api.github.com/repos/jupyter/tmpnb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jupyter/tmpnb/issues/178/comments","statuses_url":"https://api.github.com/repos/jupyter/tmpnb/statuses/ebf845e2e21264b63f41f3378f077e1f36480fe0","head":{"label":"rgbkrk:expanding-pool","ref":"expanding-pool","sha":"ebf845e2e21264b63f41f3378f077e1f36480fe0","user":{"login":"rgbkrk","id":836375,"avatar_url":"https://avatars.githubusercontent.com/u/836375?v=3","gravatar_id":"","url":"https://api.github.com/users/rgbkrk","html_url":"https://github.com/rgbkrk","followers_url":"https://api.github.com/users/rgbkrk/followers","following_url":"https://api.github.com/users/rgbkrk/following{/other_user}","gists_url":"https://api.github.com/users/rgbkrk/gists{/gist_id}","starred_url":"https://api.github.com/users/rgbkrk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rgbkrk/subscriptions","organizations_url":"https://api.github.com/users/rgbkrk/orgs","repos_url":"https://api.github.com/users/rgbkrk/repos","events_url":"https://api.github.com/users/rgbkrk/events{/privacy}","received_events_url":"https://api.github.com/users/rgbkrk/received_events","type":"User","site_admin":false},"repo":{"id":24315307,"name":"tmpnb","full_name":"rgbkrk/tmpnb","owner":{"login":"rgbkrk","id":836375,"avatar_url":"https://avatars.githubusercontent.com/u/836375?v=3","gravatar_id":"","url":"https://api.github.com/users/rgbkrk","html_url":"https://github.com/rgbkrk","followers_url":"https://api.github.com/users/rgbkrk/followers","following_url":"https://api.github.com/users/rgbkrk/following{/other_user}","gists_url":"https://api.github.com/users/rgbkrk/gists{/gist_id}","starred_url":"https://api.github.com/users/rgbkrk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rgbkrk/subscriptions","organizations_url":"https://api.github.com/users/rgbkrk/orgs","repos_url":"https://api.github.com/users/rgbkrk/repos","events_url":"https://api.github.com/users/rgbkrk/events{/privacy}","received_events_url":"https://api.github.com/users/rgbkrk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rgbkrk/tmpnb","description":"Creates temporary Jupyter Notebook servers using Docker containers.","fork":true,"url":"https://api.github.com/repos/rgbkrk/tmpnb","forks_url":"https://api.github.com/repos/rgbkrk/tmpnb/forks","keys_url":"https://api.github.com/repos/rgbkrk/tmpnb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rgbkrk/tmpnb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rgbkrk/tmpnb/teams","hooks_url":"https://api.github.com/repos/rgbkrk/tmpnb/hooks","issue_events_url":"https://api.github.com/repos/rgbkrk/tmpnb/issues/events{/number}","events_url":"https://api.github.com/repos/rgbkrk/tmpnb/events","assignees_url":"https://api.github.com/repos/rgbkrk/tmpnb/assignees{/user}","branches_url":"https://api.github.com/repos/rgbkrk/tmpnb/branches{/branch}","tags_url":"https://api.github.com/repos/rgbkrk/tmpnb/tags","blobs_url":"https://api.github.com/repos/rgbkrk/tmpnb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rgbkrk/tmpnb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rgbkrk/tmpnb/git/refs{/sha}","trees_url":"https://api.github.com/repos/rgbkrk/tmpnb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rgbkrk/tmpnb/statuses/{sha}","languages_url":"https://api.github.com/repos/rgbkrk/tmpnb/languages","stargazers_url":"https://api.github.com/repos/rgbkrk/tmpnb/stargazers","contributors_url":"https://api.github.com/repos/rgbkrk/tmpnb/contributors","subscribers_url":"https://api.github.com/repos/rgbkrk/tmpnb/subscribers","subscription_url":"https://api.github.com/repos/rgbkrk/tmpnb/subscription","commits_url":"https://api.github.com/repos/rgbkrk/tmpnb/commits{/sha}","git_commits_url":"https://api.github.com/repos/rgbkrk/tmpnb/git/commits{/sha}","comments_url":"https://api.github.com/repos/rgbkrk/tmpnb/comments{/number}","issue_comment_url":"https://api.github.com/repos/rgbkrk/tmpnb/issues/comments{/number}","contents_url":"https://api.github.com/repos/rgbkrk/tmpnb/contents/{+path}","compare_url":"https://api.github.com/repos/rgbkrk/tmpnb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rgbkrk/tmpnb/merges","archive_url":"https://api.github.com/repos/rgbkrk/tmpnb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rgbkrk/tmpnb/downloads","issues_url":"https://api.github.com/repos/rgbkrk/tmpnb/issues{/number}","pulls_url":"https://api.github.com/repos/rgbkrk/tmpnb/pulls{/number}","milestones_url":"https://api.github.com/repos/rgbkrk/tmpnb/milestones{/number}","notifications_url":"https://api.github.com/repos/rgbkrk/tmpnb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rgbkrk/tmpnb/labels{/name}","releases_url":"https://api.github.com/repos/rgbkrk/tmpnb/releases{/id}","created_at":"2014-09-22T05:22:47Z","updated_at":"2015-05-07T18:35:50Z","pushed_at":"2015-10-08T02:52:39Z","git_url":"git://github.com/rgbkrk/tmpnb.git","ssh_url":"git@github.com:rgbkrk/tmpnb.git","clone_url":"https://github.com/rgbkrk/tmpnb.git","svn_url":"https://github.com/rgbkrk/tmpnb","homepage":null,"size":1161,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"jupyter:master","ref":"master","sha":"44ff714e6e65897547dac5e0f3d73c070546617d","user":{"login":"jupyter","id":7388996,"avatar_url":"https://avatars.githubusercontent.com/u/7388996?v=3","gravatar_id":"","url":"https://api.github.com/users/jupyter","html_url":"https://github.com/jupyter","followers_url":"https://api.github.com/users/jupyter/followers","following_url":"https://api.github.com/users/jupyter/following{/other_user}","gists_url":"https://api.github.com/users/jupyter/gists{/gist_id}","starred_url":"https://api.github.com/users/jupyter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jupyter/subscriptions","organizations_url":"https://api.github.com/users/jupyter/orgs","repos_url":"https://api.github.com/users/jupyter/repos","events_url":"https://api.github.com/users/jupyter/events{/privacy}","received_events_url":"https://api.github.com/users/jupyter/received_events","type":"Organization","site_admin":false},"repo":{"id":24117219,"name":"tmpnb","full_name":"jupyter/tmpnb","owner":{"login":"jupyter","id":7388996,"avatar_url":"https://avatars.githubusercontent.com/u/7388996?v=3","gravatar_id":"","url":"https://api.github.com/users/jupyter","html_url":"https://github.com/jupyter","followers_url":"https://api.github.com/users/jupyter/followers","following_url":"https://api.github.com/users/jupyter/following{/other_user}","gists_url":"https://api.github.com/users/jupyter/gists{/gist_id}","starred_url":"https://api.github.com/users/jupyter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jupyter/subscriptions","organizations_url":"https://api.github.com/users/jupyter/orgs","repos_url":"https://api.github.com/users/jupyter/repos","events_url":"https://api.github.com/users/jupyter/events{/privacy}","received_events_url":"https://api.github.com/users/jupyter/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jupyter/tmpnb","description":"Creates temporary Jupyter Notebook servers using Docker containers.","fork":false,"url":"https://api.github.com/repos/jupyter/tmpnb","forks_url":"https://api.github.com/repos/jupyter/tmpnb/forks","keys_url":"https://api.github.com/repos/jupyter/tmpnb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jupyter/tmpnb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jupyter/tmpnb/teams","hooks_url":"https://api.github.com/repos/jupyter/tmpnb/hooks","issue_events_url":"https://api.github.com/repos/jupyter/tmpnb/issues/events{/number}","events_url":"https://api.github.com/repos/jupyter/tmpnb/events","assignees_url":"https://api.github.com/repos/jupyter/tmpnb/assignees{/user}","branches_url":"https://api.github.com/repos/jupyter/tmpnb/branches{/branch}","tags_url":"https://api.github.com/repos/jupyter/tmpnb/tags","blobs_url":"https://api.github.com/repos/jupyter/tmpnb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jupyter/tmpnb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jupyter/tmpnb/git/refs{/sha}","trees_url":"https://api.github.com/repos/jupyter/tmpnb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jupyter/tmpnb/statuses/{sha}","languages_url":"https://api.github.com/repos/jupyter/tmpnb/languages","stargazers_url":"https://api.github.com/repos/jupyter/tmpnb/stargazers","contributors_url":"https://api.github.com/repos/jupyter/tmpnb/contributors","subscribers_url":"https://api.github.com/repos/jupyter/tmpnb/subscribers","subscription_url":"https://api.github.com/repos/jupyter/tmpnb/subscription","commits_url":"https://api.github.com/repos/jupyter/tmpnb/commits{/sha}","git_commits_url":"https://api.github.com/repos/jupyter/tmpnb/git/commits{/sha}","comments_url":"https://api.github.com/repos/jupyter/tmpnb/comments{/number}","issue_comment_url":"https://api.github.com/repos/jupyter/tmpnb/issues/comments{/number}","contents_url":"https://api.github.com/repos/jupyter/tmpnb/contents/{+path}","compare_url":"https://api.github.com/repos/jupyter/tmpnb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jupyter/tmpnb/merges","archive_url":"https://api.github.com/repos/jupyter/tmpnb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jupyter/tmpnb/downloads","issues_url":"https://api.github.com/repos/jupyter/tmpnb/issues{/number}","pulls_url":"https://api.github.com/repos/jupyter/tmpnb/pulls{/number}","milestones_url":"https://api.github.com/repos/jupyter/tmpnb/milestones{/number}","notifications_url":"https://api.github.com/repos/jupyter/tmpnb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jupyter/tmpnb/labels{/name}","releases_url":"https://api.github.com/repos/jupyter/tmpnb/releases{/id}","created_at":"2014-09-16T20:49:42Z","updated_at":"2015-10-09T08:07:11Z","pushed_at":"2015-10-08T03:04:46Z","git_url":"git://github.com/jupyter/tmpnb.git","ssh_url":"git@github.com:jupyter/tmpnb.git","clone_url":"https://github.com/jupyter/tmpnb.git","svn_url":"https://github.com/jupyter/tmpnb","homepage":null,"size":1591,"stargazers_count":258,"watchers_count":258,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":49,"mirror_url":null,"open_issues_count":25,"forks":49,"open_issues":25,"watchers":258,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jupyter/tmpnb/pulls/178"},"html":{"href":"https://github.com/jupyter/tmpnb/pull/178"},"issue":{"href":"https://api.github.com/repos/jupyter/tmpnb/issues/178"},"comments":{"href":"https://api.github.com/repos/jupyter/tmpnb/issues/178/comments"},"review_comments":{"href":"https://api.github.com/repos/jupyter/tmpnb/pulls/178/comments"},"review_comment":{"href":"https://api.github.com/repos/jupyter/tmpnb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jupyter/tmpnb/pulls/178/commits"},"statuses":{"href":"https://api.github.com/repos/jupyter/tmpnb/statuses/ebf845e2e21264b63f41f3378f077e1f36480fe0"}}}}