{"action":"created","comment":{"url":"https://api.github.com/repos/LagerApp/Lager/pulls/comments/39660838","id":39660838,"diff_hunk":"@@ -32,6 +32,16 @@ class App\n     @services.to_json(:include => :servers)\n   end\n \n+  post '/services' do\n+   services_params = params[\"services\"]\n+   halt(401, \"Not authorized\") unless services_params\n+   services_params[\"servers\"].each do |server_name|\n+      server = Server.find_by(label: server_name)\n+      service = Service.create(name: services_params[\"name\"], service_type: 'db', log_path: services_params[\"log_path\"])","path":"lib/lager.rb","position":9,"original_position":9,"commit_id":"7f918c667a49e539cb24882e01531acad1635bbe","original_commit_id":"7f918c667a49e539cb24882e01531acad1635bbe","user":{"login":"xbili","id":4846457,"avatar_url":"https://avatars.githubusercontent.com/u/4846457?v=3","gravatar_id":"","url":"https://api.github.com/users/xbili","html_url":"https://github.com/xbili","followers_url":"https://api.github.com/users/xbili/followers","following_url":"https://api.github.com/users/xbili/following{/other_user}","gists_url":"https://api.github.com/users/xbili/gists{/gist_id}","starred_url":"https://api.github.com/users/xbili/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xbili/subscriptions","organizations_url":"https://api.github.com/users/xbili/orgs","repos_url":"https://api.github.com/users/xbili/repos","events_url":"https://api.github.com/users/xbili/events{/privacy}","received_events_url":"https://api.github.com/users/xbili/received_events","type":"User","site_admin":false},"body":"Leaving the `service_type` as `'db'` for now.","created_at":"2015-09-16T17:39:03Z","updated_at":"2015-09-16T17:39:03Z","html_url":"https://github.com/LagerApp/Lager/pull/26#discussion_r39660838","pull_request_url":"https://api.github.com/repos/LagerApp/Lager/pulls/26","_links":{"self":{"href":"https://api.github.com/repos/LagerApp/Lager/pulls/comments/39660838"},"html":{"href":"https://github.com/LagerApp/Lager/pull/26#discussion_r39660838"},"pull_request":{"href":"https://api.github.com/repos/LagerApp/Lager/pulls/26"}}},"pull_request":{"url":"https://api.github.com/repos/LagerApp/Lager/pulls/26","id":45201485,"html_url":"https://github.com/LagerApp/Lager/pull/26","diff_url":"https://github.com/LagerApp/Lager/pull/26.diff","patch_url":"https://github.com/LagerApp/Lager/pull/26.patch","issue_url":"https://api.github.com/repos/LagerApp/Lager/issues/26","number":26,"state":"open","locked":false,"title":"Create new services","user":{"login":"xbili","id":4846457,"avatar_url":"https://avatars.githubusercontent.com/u/4846457?v=3","gravatar_id":"","url":"https://api.github.com/users/xbili","html_url":"https://github.com/xbili","followers_url":"https://api.github.com/users/xbili/followers","following_url":"https://api.github.com/users/xbili/following{/other_user}","gists_url":"https://api.github.com/users/xbili/gists{/gist_id}","starred_url":"https://api.github.com/users/xbili/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xbili/subscriptions","organizations_url":"https://api.github.com/users/xbili/orgs","repos_url":"https://api.github.com/users/xbili/repos","events_url":"https://api.github.com/users/xbili/events{/privacy}","received_events_url":"https://api.github.com/users/xbili/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-09-16T17:38:36Z","updated_at":"2015-09-16T17:39:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"62d369710d2b830460f9211de09a9268cf2d6c7c","assignee":{"login":"xbili","id":4846457,"avatar_url":"https://avatars.githubusercontent.com/u/4846457?v=3","gravatar_id":"","url":"https://api.github.com/users/xbili","html_url":"https://github.com/xbili","followers_url":"https://api.github.com/users/xbili/followers","following_url":"https://api.github.com/users/xbili/following{/other_user}","gists_url":"https://api.github.com/users/xbili/gists{/gist_id}","starred_url":"https://api.github.com/users/xbili/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xbili/subscriptions","organizations_url":"https://api.github.com/users/xbili/orgs","repos_url":"https://api.github.com/users/xbili/repos","events_url":"https://api.github.com/users/xbili/events{/privacy}","received_events_url":"https://api.github.com/users/xbili/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/LagerApp/Lager/pulls/26/commits","review_comments_url":"https://api.github.com/repos/LagerApp/Lager/pulls/26/comments","review_comment_url":"https://api.github.com/repos/LagerApp/Lager/pulls/comments{/number}","comments_url":"https://api.github.com/repos/LagerApp/Lager/issues/26/comments","statuses_url":"https://api.github.com/repos/LagerApp/Lager/statuses/7f918c667a49e539cb24882e01531acad1635bbe","head":{"label":"LagerApp:feature/create-services","ref":"feature/create-services","sha":"7f918c667a49e539cb24882e01531acad1635bbe","user":{"login":"LagerApp","id":14148041,"avatar_url":"https://avatars.githubusercontent.com/u/14148041?v=3","gravatar_id":"","url":"https://api.github.com/users/LagerApp","html_url":"https://github.com/LagerApp","followers_url":"https://api.github.com/users/LagerApp/followers","following_url":"https://api.github.com/users/LagerApp/following{/other_user}","gists_url":"https://api.github.com/users/LagerApp/gists{/gist_id}","starred_url":"https://api.github.com/users/LagerApp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LagerApp/subscriptions","organizations_url":"https://api.github.com/users/LagerApp/orgs","repos_url":"https://api.github.com/users/LagerApp/repos","events_url":"https://api.github.com/users/LagerApp/events{/privacy}","received_events_url":"https://api.github.com/users/LagerApp/received_events","type":"Organization","site_admin":false},"repo":{"id":42065752,"name":"Lager","full_name":"LagerApp/Lager","owner":{"login":"LagerApp","id":14148041,"avatar_url":"https://avatars.githubusercontent.com/u/14148041?v=3","gravatar_id":"","url":"https://api.github.com/users/LagerApp","html_url":"https://github.com/LagerApp","followers_url":"https://api.github.com/users/LagerApp/followers","following_url":"https://api.github.com/users/LagerApp/following{/other_user}","gists_url":"https://api.github.com/users/LagerApp/gists{/gist_id}","starred_url":"https://api.github.com/users/LagerApp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LagerApp/subscriptions","organizations_url":"https://api.github.com/users/LagerApp/orgs","repos_url":"https://api.github.com/users/LagerApp/repos","events_url":"https://api.github.com/users/LagerApp/events{/privacy}","received_events_url":"https://api.github.com/users/LagerApp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/LagerApp/Lager","description":"Beer ❤ DevOps","fork":false,"url":"https://api.github.com/repos/LagerApp/Lager","forks_url":"https://api.github.com/repos/LagerApp/Lager/forks","keys_url":"https://api.github.com/repos/LagerApp/Lager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LagerApp/Lager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LagerApp/Lager/teams","hooks_url":"https://api.github.com/repos/LagerApp/Lager/hooks","issue_events_url":"https://api.github.com/repos/LagerApp/Lager/issues/events{/number}","events_url":"https://api.github.com/repos/LagerApp/Lager/events","assignees_url":"https://api.github.com/repos/LagerApp/Lager/assignees{/user}","branches_url":"https://api.github.com/repos/LagerApp/Lager/branches{/branch}","tags_url":"https://api.github.com/repos/LagerApp/Lager/tags","blobs_url":"https://api.github.com/repos/LagerApp/Lager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LagerApp/Lager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LagerApp/Lager/git/refs{/sha}","trees_url":"https://api.github.com/repos/LagerApp/Lager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LagerApp/Lager/statuses/{sha}","languages_url":"https://api.github.com/repos/LagerApp/Lager/languages","stargazers_url":"https://api.github.com/repos/LagerApp/Lager/stargazers","contributors_url":"https://api.github.com/repos/LagerApp/Lager/contributors","subscribers_url":"https://api.github.com/repos/LagerApp/Lager/subscribers","subscription_url":"https://api.github.com/repos/LagerApp/Lager/subscription","commits_url":"https://api.github.com/repos/LagerApp/Lager/commits{/sha}","git_commits_url":"https://api.github.com/repos/LagerApp/Lager/git/commits{/sha}","comments_url":"https://api.github.com/repos/LagerApp/Lager/comments{/number}","issue_comment_url":"https://api.github.com/repos/LagerApp/Lager/issues/comments{/number}","contents_url":"https://api.github.com/repos/LagerApp/Lager/contents/{+path}","compare_url":"https://api.github.com/repos/LagerApp/Lager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LagerApp/Lager/merges","archive_url":"https://api.github.com/repos/LagerApp/Lager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LagerApp/Lager/downloads","issues_url":"https://api.github.com/repos/LagerApp/Lager/issues{/number}","pulls_url":"https://api.github.com/repos/LagerApp/Lager/pulls{/number}","milestones_url":"https://api.github.com/repos/LagerApp/Lager/milestones{/number}","notifications_url":"https://api.github.com/repos/LagerApp/Lager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LagerApp/Lager/labels{/name}","releases_url":"https://api.github.com/repos/LagerApp/Lager/releases{/id}","created_at":"2015-09-07T17:21:49Z","updated_at":"2015-09-08T16:03:16Z","pushed_at":"2015-09-16T17:38:36Z","git_url":"git://github.com/LagerApp/Lager.git","ssh_url":"git@github.com:LagerApp/Lager.git","clone_url":"https://github.com/LagerApp/Lager.git","svn_url":"https://github.com/LagerApp/Lager","homepage":"http://lagerapp.io","size":724,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":15,"forks":0,"open_issues":15,"watchers":0,"default_branch":"master"}},"base":{"label":"LagerApp:master","ref":"master","sha":"3db99b9c38956c2f0e8d97f470356f3b7dbf9d58","user":{"login":"LagerApp","id":14148041,"avatar_url":"https://avatars.githubusercontent.com/u/14148041?v=3","gravatar_id":"","url":"https://api.github.com/users/LagerApp","html_url":"https://github.com/LagerApp","followers_url":"https://api.github.com/users/LagerApp/followers","following_url":"https://api.github.com/users/LagerApp/following{/other_user}","gists_url":"https://api.github.com/users/LagerApp/gists{/gist_id}","starred_url":"https://api.github.com/users/LagerApp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LagerApp/subscriptions","organizations_url":"https://api.github.com/users/LagerApp/orgs","repos_url":"https://api.github.com/users/LagerApp/repos","events_url":"https://api.github.com/users/LagerApp/events{/privacy}","received_events_url":"https://api.github.com/users/LagerApp/received_events","type":"Organization","site_admin":false},"repo":{"id":42065752,"name":"Lager","full_name":"LagerApp/Lager","owner":{"login":"LagerApp","id":14148041,"avatar_url":"https://avatars.githubusercontent.com/u/14148041?v=3","gravatar_id":"","url":"https://api.github.com/users/LagerApp","html_url":"https://github.com/LagerApp","followers_url":"https://api.github.com/users/LagerApp/followers","following_url":"https://api.github.com/users/LagerApp/following{/other_user}","gists_url":"https://api.github.com/users/LagerApp/gists{/gist_id}","starred_url":"https://api.github.com/users/LagerApp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LagerApp/subscriptions","organizations_url":"https://api.github.com/users/LagerApp/orgs","repos_url":"https://api.github.com/users/LagerApp/repos","events_url":"https://api.github.com/users/LagerApp/events{/privacy}","received_events_url":"https://api.github.com/users/LagerApp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/LagerApp/Lager","description":"Beer ❤ DevOps","fork":false,"url":"https://api.github.com/repos/LagerApp/Lager","forks_url":"https://api.github.com/repos/LagerApp/Lager/forks","keys_url":"https://api.github.com/repos/LagerApp/Lager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LagerApp/Lager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LagerApp/Lager/teams","hooks_url":"https://api.github.com/repos/LagerApp/Lager/hooks","issue_events_url":"https://api.github.com/repos/LagerApp/Lager/issues/events{/number}","events_url":"https://api.github.com/repos/LagerApp/Lager/events","assignees_url":"https://api.github.com/repos/LagerApp/Lager/assignees{/user}","branches_url":"https://api.github.com/repos/LagerApp/Lager/branches{/branch}","tags_url":"https://api.github.com/repos/LagerApp/Lager/tags","blobs_url":"https://api.github.com/repos/LagerApp/Lager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LagerApp/Lager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LagerApp/Lager/git/refs{/sha}","trees_url":"https://api.github.com/repos/LagerApp/Lager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LagerApp/Lager/statuses/{sha}","languages_url":"https://api.github.com/repos/LagerApp/Lager/languages","stargazers_url":"https://api.github.com/repos/LagerApp/Lager/stargazers","contributors_url":"https://api.github.com/repos/LagerApp/Lager/contributors","subscribers_url":"https://api.github.com/repos/LagerApp/Lager/subscribers","subscription_url":"https://api.github.com/repos/LagerApp/Lager/subscription","commits_url":"https://api.github.com/repos/LagerApp/Lager/commits{/sha}","git_commits_url":"https://api.github.com/repos/LagerApp/Lager/git/commits{/sha}","comments_url":"https://api.github.com/repos/LagerApp/Lager/comments{/number}","issue_comment_url":"https://api.github.com/repos/LagerApp/Lager/issues/comments{/number}","contents_url":"https://api.github.com/repos/LagerApp/Lager/contents/{+path}","compare_url":"https://api.github.com/repos/LagerApp/Lager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LagerApp/Lager/merges","archive_url":"https://api.github.com/repos/LagerApp/Lager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LagerApp/Lager/downloads","issues_url":"https://api.github.com/repos/LagerApp/Lager/issues{/number}","pulls_url":"https://api.github.com/repos/LagerApp/Lager/pulls{/number}","milestones_url":"https://api.github.com/repos/LagerApp/Lager/milestones{/number}","notifications_url":"https://api.github.com/repos/LagerApp/Lager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LagerApp/Lager/labels{/name}","releases_url":"https://api.github.com/repos/LagerApp/Lager/releases{/id}","created_at":"2015-09-07T17:21:49Z","updated_at":"2015-09-08T16:03:16Z","pushed_at":"2015-09-16T17:38:36Z","git_url":"git://github.com/LagerApp/Lager.git","ssh_url":"git@github.com:LagerApp/Lager.git","clone_url":"https://github.com/LagerApp/Lager.git","svn_url":"https://github.com/LagerApp/Lager","homepage":"http://lagerapp.io","size":724,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":15,"forks":0,"open_issues":15,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/LagerApp/Lager/pulls/26"},"html":{"href":"https://github.com/LagerApp/Lager/pull/26"},"issue":{"href":"https://api.github.com/repos/LagerApp/Lager/issues/26"},"comments":{"href":"https://api.github.com/repos/LagerApp/Lager/issues/26/comments"},"review_comments":{"href":"https://api.github.com/repos/LagerApp/Lager/pulls/26/comments"},"review_comment":{"href":"https://api.github.com/repos/LagerApp/Lager/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/LagerApp/Lager/pulls/26/commits"},"statuses":{"href":"https://api.github.com/repos/LagerApp/Lager/statuses/7f918c667a49e539cb24882e01531acad1635bbe"}}}}