{"action":"created","comment":{"url":"https://api.github.com/repos/eclipse/che/pulls/comments/80678371","pull_request_review_id":1718821,"id":80678371,"diff_hunk":"@@ -656,6 +667,43 @@ public void deleteProject(@ApiParam(\"The workspace id\")\n         }\n     }\n \n+    @GET\n+    @Path(\"/{id}/check\")\n+    @Produces(APPLICATION_JSON)\n+    @ApiOperation(value = \"Get state of the workspace agent by the workspace id and agent id\")\n+    @ApiResponses({@ApiResponse(code = 200, message = \"The response contains requested workspace entity\"),\n+                   @ApiResponse(code = 404, message = \"The workspace with specified id does not exist\"),\n+                   @ApiResponse(code = 403, message = \"The user is not workspace owner\"),\n+                   @ApiResponse(code = 500, message = \"Internal server error occurred\")})\n+    public WsAgentHealthStateDto checkAgentHealth(@ApiParam(value = \"Workspace id\")\n+                                                  @PathParam(\"id\") String key) throws NotFoundException,\n+                                                                                             ServerException,\n+                                                                                             ForbiddenException,\n+                                                                                             BadRequestException,\n+                                                                                             UnauthorizedException,\n+                                                                                             IOException,\n+                                                                                             ConflictException {\n+        validateKey(key);\n+        final WorkspaceImpl workspace = workspaceManager.getWorkspace(key);\n+        if (WorkspaceStatus.RUNNING != workspace.getStatus()) {\n+            return newDto(WsAgentHealthStateDto.class).withWorkspaceStatus(workspace.getStatus());\n+        }\n+\n+        final MachineImpl devMachine = workspace.getRuntime().getDevMachine();\n+        if (devMachine == null) {\n+            return newDto(WsAgentHealthStateDto.class)\n+                    .withWorkspaceStatus(workspace.getStatus())\n+                    .withCode(NOT_FOUND.getStatusCode())\n+                    .withReason(\"Workspace Agent isn't available if Dev machine isn't RUNNING\");\n+        }\n+\n+        final WsAgentHealthStateDto check = agentHealthChecker.check(devMachine);\n+\n+        check.setWorkspaceStatus(workspace.getStatus());\n+","path":"wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/WorkspaceService.java","position":105,"original_position":105,"commit_id":"097e51e69a256fede87d8a1e007f61e6edc364bc","original_commit_id":"097e51e69a256fede87d8a1e007f61e6edc364bc","user":{"login":"skabashnyuk","id":1614429,"avatar_url":"https://avatars.githubusercontent.com/u/1614429?v=3","gravatar_id":"","url":"https://api.github.com/users/skabashnyuk","html_url":"https://github.com/skabashnyuk","followers_url":"https://api.github.com/users/skabashnyuk/followers","following_url":"https://api.github.com/users/skabashnyuk/following{/other_user}","gists_url":"https://api.github.com/users/skabashnyuk/gists{/gist_id}","starred_url":"https://api.github.com/users/skabashnyuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skabashnyuk/subscriptions","organizations_url":"https://api.github.com/users/skabashnyuk/orgs","repos_url":"https://api.github.com/users/skabashnyuk/repos","events_url":"https://api.github.com/users/skabashnyuk/events{/privacy}","received_events_url":"https://api.github.com/users/skabashnyuk/received_events","type":"User","site_admin":false},"body":"extra space","created_at":"2016-09-27T12:19:33Z","updated_at":"2016-09-27T12:20:41Z","html_url":"https://github.com/eclipse/che/pull/2530#discussion_r80678371","pull_request_url":"https://api.github.com/repos/eclipse/che/pulls/2530","_links":{"self":{"href":"https://api.github.com/repos/eclipse/che/pulls/comments/80678371"},"html":{"href":"https://github.com/eclipse/che/pull/2530#discussion_r80678371"},"pull_request":{"href":"https://api.github.com/repos/eclipse/che/pulls/2530"}}},"pull_request":{"url":"https://api.github.com/repos/eclipse/che/pulls/2530","id":86181469,"html_url":"https://github.com/eclipse/che/pull/2530","diff_url":"https://github.com/eclipse/che/pull/2530.diff","patch_url":"https://github.com/eclipse/che/pull/2530.patch","issue_url":"https://api.github.com/repos/eclipse/che/issues/2530","number":2530,"state":"open","locked":false,"title":"CHE-2369: add a mechanism which checks state of the ws agent","user":{"login":"svor","id":1271546,"avatar_url":"https://avatars.githubusercontent.com/u/1271546?v=3","gravatar_id":"","url":"https://api.github.com/users/svor","html_url":"https://github.com/svor","followers_url":"https://api.github.com/users/svor/followers","following_url":"https://api.github.com/users/svor/following{/other_user}","gists_url":"https://api.github.com/users/svor/gists{/gist_id}","starred_url":"https://api.github.com/users/svor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svor/subscriptions","organizations_url":"https://api.github.com/users/svor/orgs","repos_url":"https://api.github.com/users/svor/repos","events_url":"https://api.github.com/users/svor/events{/privacy}","received_events_url":"https://api.github.com/users/svor/received_events","type":"User","site_admin":false},"body":"### What does this PR do?\r\nAdds a service which periodically pings ws agent and notify a user when something is happened.\r\n\r\n### What issues does this PR fix or reference?\r\nhttps://github.com/eclipse/che/issues/2369\r\n\r\n### Previous behavior\r\nWhen ws agent stops responding a user don't get any response about this and don't know what is happened.\r\n\r\n### PR type\r\n- [x] Minor change = no change to existing features or docs\r\n- [ ] Major change = changes existing features or docs\r\n\r\n### Minor change checklist\r\n- [ ] New API required?\r\n- [ ] API updated\r\n- [x] Tests provided / updated\r\n- [x] Tests passed\r\n\r\n@vparfonov please take a look","created_at":"2016-09-21T15:05:51Z","updated_at":"2016-09-27T12:20:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"30e81ef356c64cc5b5405a6f63ed22208fe37293","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/eclipse/che/pulls/2530/commits","review_comments_url":"https://api.github.com/repos/eclipse/che/pulls/2530/comments","review_comment_url":"https://api.github.com/repos/eclipse/che/pulls/comments{/number}","comments_url":"https://api.github.com/repos/eclipse/che/issues/2530/comments","statuses_url":"https://api.github.com/repos/eclipse/che/statuses/097e51e69a256fede87d8a1e007f61e6edc364bc","head":{"label":"eclipse:CHE-1988","ref":"CHE-1988","sha":"097e51e69a256fede87d8a1e007f61e6edc364bc","user":{"login":"eclipse","id":56974,"avatar_url":"https://avatars.githubusercontent.com/u/56974?v=3","gravatar_id":"","url":"https://api.github.com/users/eclipse","html_url":"https://github.com/eclipse","followers_url":"https://api.github.com/users/eclipse/followers","following_url":"https://api.github.com/users/eclipse/following{/other_user}","gists_url":"https://api.github.com/users/eclipse/gists{/gist_id}","starred_url":"https://api.github.com/users/eclipse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eclipse/subscriptions","organizations_url":"https://api.github.com/users/eclipse/orgs","repos_url":"https://api.github.com/users/eclipse/repos","events_url":"https://api.github.com/users/eclipse/events{/privacy}","received_events_url":"https://api.github.com/users/eclipse/received_events","type":"Organization","site_admin":false},"repo":{"id":32935745,"name":"che","full_name":"eclipse/che","owner":{"login":"eclipse","id":56974,"avatar_url":"https://avatars.githubusercontent.com/u/56974?v=3","gravatar_id":"","url":"https://api.github.com/users/eclipse","html_url":"https://github.com/eclipse","followers_url":"https://api.github.com/users/eclipse/followers","following_url":"https://api.github.com/users/eclipse/following{/other_user}","gists_url":"https://api.github.com/users/eclipse/gists{/gist_id}","starred_url":"https://api.github.com/users/eclipse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eclipse/subscriptions","organizations_url":"https://api.github.com/users/eclipse/orgs","repos_url":"https://api.github.com/users/eclipse/repos","events_url":"https://api.github.com/users/eclipse/events{/privacy}","received_events_url":"https://api.github.com/users/eclipse/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/eclipse/che","description":"Eclipse Che: Next-generation Eclipse IDE.  Open source workspace server and cloud IDE.","fork":false,"url":"https://api.github.com/repos/eclipse/che","forks_url":"https://api.github.com/repos/eclipse/che/forks","keys_url":"https://api.github.com/repos/eclipse/che/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eclipse/che/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eclipse/che/teams","hooks_url":"https://api.github.com/repos/eclipse/che/hooks","issue_events_url":"https://api.github.com/repos/eclipse/che/issues/events{/number}","events_url":"https://api.github.com/repos/eclipse/che/events","assignees_url":"https://api.github.com/repos/eclipse/che/assignees{/user}","branches_url":"https://api.github.com/repos/eclipse/che/branches{/branch}","tags_url":"https://api.github.com/repos/eclipse/che/tags","blobs_url":"https://api.github.com/repos/eclipse/che/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eclipse/che/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eclipse/che/git/refs{/sha}","trees_url":"https://api.github.com/repos/eclipse/che/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eclipse/che/statuses/{sha}","languages_url":"https://api.github.com/repos/eclipse/che/languages","stargazers_url":"https://api.github.com/repos/eclipse/che/stargazers","contributors_url":"https://api.github.com/repos/eclipse/che/contributors","subscribers_url":"https://api.github.com/repos/eclipse/che/subscribers","subscription_url":"https://api.github.com/repos/eclipse/che/subscription","commits_url":"https://api.github.com/repos/eclipse/che/commits{/sha}","git_commits_url":"https://api.github.com/repos/eclipse/che/git/commits{/sha}","comments_url":"https://api.github.com/repos/eclipse/che/comments{/number}","issue_comment_url":"https://api.github.com/repos/eclipse/che/issues/comments{/number}","contents_url":"https://api.github.com/repos/eclipse/che/contents/{+path}","compare_url":"https://api.github.com/repos/eclipse/che/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eclipse/che/merges","archive_url":"https://api.github.com/repos/eclipse/che/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eclipse/che/downloads","issues_url":"https://api.github.com/repos/eclipse/che/issues{/number}","pulls_url":"https://api.github.com/repos/eclipse/che/pulls{/number}","milestones_url":"https://api.github.com/repos/eclipse/che/milestones{/number}","notifications_url":"https://api.github.com/repos/eclipse/che/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eclipse/che/labels{/name}","releases_url":"https://api.github.com/repos/eclipse/che/releases{/id}","deployments_url":"https://api.github.com/repos/eclipse/che/deployments","created_at":"2015-03-26T15:31:01Z","updated_at":"2016-09-27T03:54:27Z","pushed_at":"2016-09-27T12:11:37Z","git_url":"git://github.com/eclipse/che.git","ssh_url":"git@github.com:eclipse/che.git","clone_url":"https://github.com/eclipse/che.git","svn_url":"https://github.com/eclipse/che","homepage":"http://eclipse.org/che","size":52499,"stargazers_count":3215,"watchers_count":3215,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":524,"mirror_url":null,"open_issues_count":300,"forks":524,"open_issues":300,"watchers":3215,"default_branch":"master"}},"base":{"label":"eclipse:master","ref":"master","sha":"6e3aa1c49ef25c171cd01bcb8bcda1ad2a4a8b90","user":{"login":"eclipse","id":56974,"avatar_url":"https://avatars.githubusercontent.com/u/56974?v=3","gravatar_id":"","url":"https://api.github.com/users/eclipse","html_url":"https://github.com/eclipse","followers_url":"https://api.github.com/users/eclipse/followers","following_url":"https://api.github.com/users/eclipse/following{/other_user}","gists_url":"https://api.github.com/users/eclipse/gists{/gist_id}","starred_url":"https://api.github.com/users/eclipse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eclipse/subscriptions","organizations_url":"https://api.github.com/users/eclipse/orgs","repos_url":"https://api.github.com/users/eclipse/repos","events_url":"https://api.github.com/users/eclipse/events{/privacy}","received_events_url":"https://api.github.com/users/eclipse/received_events","type":"Organization","site_admin":false},"repo":{"id":32935745,"name":"che","full_name":"eclipse/che","owner":{"login":"eclipse","id":56974,"avatar_url":"https://avatars.githubusercontent.com/u/56974?v=3","gravatar_id":"","url":"https://api.github.com/users/eclipse","html_url":"https://github.com/eclipse","followers_url":"https://api.github.com/users/eclipse/followers","following_url":"https://api.github.com/users/eclipse/following{/other_user}","gists_url":"https://api.github.com/users/eclipse/gists{/gist_id}","starred_url":"https://api.github.com/users/eclipse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eclipse/subscriptions","organizations_url":"https://api.github.com/users/eclipse/orgs","repos_url":"https://api.github.com/users/eclipse/repos","events_url":"https://api.github.com/users/eclipse/events{/privacy}","received_events_url":"https://api.github.com/users/eclipse/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/eclipse/che","description":"Eclipse Che: Next-generation Eclipse IDE.  Open source workspace server and cloud IDE.","fork":false,"url":"https://api.github.com/repos/eclipse/che","forks_url":"https://api.github.com/repos/eclipse/che/forks","keys_url":"https://api.github.com/repos/eclipse/che/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eclipse/che/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eclipse/che/teams","hooks_url":"https://api.github.com/repos/eclipse/che/hooks","issue_events_url":"https://api.github.com/repos/eclipse/che/issues/events{/number}","events_url":"https://api.github.com/repos/eclipse/che/events","assignees_url":"https://api.github.com/repos/eclipse/che/assignees{/user}","branches_url":"https://api.github.com/repos/eclipse/che/branches{/branch}","tags_url":"https://api.github.com/repos/eclipse/che/tags","blobs_url":"https://api.github.com/repos/eclipse/che/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eclipse/che/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eclipse/che/git/refs{/sha}","trees_url":"https://api.github.com/repos/eclipse/che/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eclipse/che/statuses/{sha}","languages_url":"https://api.github.com/repos/eclipse/che/languages","stargazers_url":"https://api.github.com/repos/eclipse/che/stargazers","contributors_url":"https://api.github.com/repos/eclipse/che/contributors","subscribers_url":"https://api.github.com/repos/eclipse/che/subscribers","subscription_url":"https://api.github.com/repos/eclipse/che/subscription","commits_url":"https://api.github.com/repos/eclipse/che/commits{/sha}","git_commits_url":"https://api.github.com/repos/eclipse/che/git/commits{/sha}","comments_url":"https://api.github.com/repos/eclipse/che/comments{/number}","issue_comment_url":"https://api.github.com/repos/eclipse/che/issues/comments{/number}","contents_url":"https://api.github.com/repos/eclipse/che/contents/{+path}","compare_url":"https://api.github.com/repos/eclipse/che/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eclipse/che/merges","archive_url":"https://api.github.com/repos/eclipse/che/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eclipse/che/downloads","issues_url":"https://api.github.com/repos/eclipse/che/issues{/number}","pulls_url":"https://api.github.com/repos/eclipse/che/pulls{/number}","milestones_url":"https://api.github.com/repos/eclipse/che/milestones{/number}","notifications_url":"https://api.github.com/repos/eclipse/che/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eclipse/che/labels{/name}","releases_url":"https://api.github.com/repos/eclipse/che/releases{/id}","deployments_url":"https://api.github.com/repos/eclipse/che/deployments","created_at":"2015-03-26T15:31:01Z","updated_at":"2016-09-27T03:54:27Z","pushed_at":"2016-09-27T12:11:37Z","git_url":"git://github.com/eclipse/che.git","ssh_url":"git@github.com:eclipse/che.git","clone_url":"https://github.com/eclipse/che.git","svn_url":"https://github.com/eclipse/che","homepage":"http://eclipse.org/che","size":52499,"stargazers_count":3215,"watchers_count":3215,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":524,"mirror_url":null,"open_issues_count":300,"forks":524,"open_issues":300,"watchers":3215,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/eclipse/che/pulls/2530"},"html":{"href":"https://github.com/eclipse/che/pull/2530"},"issue":{"href":"https://api.github.com/repos/eclipse/che/issues/2530"},"comments":{"href":"https://api.github.com/repos/eclipse/che/issues/2530/comments"},"review_comments":{"href":"https://api.github.com/repos/eclipse/che/pulls/2530/comments"},"review_comment":{"href":"https://api.github.com/repos/eclipse/che/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/eclipse/che/pulls/2530/commits"},"statuses":{"href":"https://api.github.com/repos/eclipse/che/statuses/097e51e69a256fede87d8a1e007f61e6edc364bc"}}}}
{"actor":{"display_login":"skabashnyuk"}}