{"action":"closed","number":1539,"pull_request":{"url":"https://api.github.com/repos/project-hatohol/hatohol/pulls/1539","id":43835418,"html_url":"https://github.com/project-hatohol/hatohol/pull/1539","diff_url":"https://github.com/project-hatohol/hatohol/pull/1539.diff","patch_url":"https://github.com/project-hatohol/hatohol/pull/1539.patch","issue_url":"https://api.github.com/repos/project-hatohol/hatohol/issues/1539","number":1539,"state":"closed","locked":false,"title":"[FaceRest] Add queries to select or exclude {server,hostgroups,hosts}","user":{"login":"ashie","id":135104,"avatar_url":"https://avatars.githubusercontent.com/u/135104?v=3","gravatar_id":"","url":"https://api.github.com/users/ashie","html_url":"https://github.com/ashie","followers_url":"https://api.github.com/users/ashie/followers","following_url":"https://api.github.com/users/ashie/following{/other_user}","gists_url":"https://api.github.com/users/ashie/gists{/gist_id}","starred_url":"https://api.github.com/users/ashie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashie/subscriptions","organizations_url":"https://api.github.com/users/ashie/orgs","repos_url":"https://api.github.com/users/ashie/repos","events_url":"https://api.github.com/users/ashie/events{/privacy}","received_events_url":"https://api.github.com/users/ashie/received_events","type":"User","site_admin":false},"body":"It's the Web API for #1538.\r\n\r\nExample query:\r\n\r\n```\r\n/events?selectHosts%5B0%5D%5BserverId%5D=1&selectHosts%5B1%5D%5BserverId%5D=2&selectHosts%5B1%5D%5BhostgroupId%5D=3&selectHosts%5B2%5D%5BserverId%5D=4&selectHosts%5B2%5D%5BhostId%5D=5&excludeHosts%5B0%5D%5BserverId%5D=2&excludeHosts%5B1%5D%5BserverId%5D=6&excludeHosts%5B1%5D%5BhostgroupId%5D=7&excludeHosts%5B2%5D%5BserverId%5D=8&excludeHosts%5B2%5D%5BhostId%5D=9\r\n```\r\n\r\nThe decoded string of the query part:\r\n\r\n```\r\nselectHosts[0][serverId]=1&selectHosts[1][serverId]=2&selectHosts[1][hostgroupId]=3&selectHosts[2][serverId]=4&selectHosts[2][hostId]=5&excludeHosts[0][serverId]=2&excludeHosts[1][serverId]=6&excludeHosts[1][hostgroupId]=7&excludeHosts[2][serverId]=8&excludeHosts[2][hostId]=9\r\n```\r\n\r\nIt can be generated by $.param():\r\n\r\n```js\r\nvar exampleQuery = {\r\n  selectHosts: [\r\n    {serverId: 1},\r\n    {serverId: 2, hostgroupId: 3},\r\n    {serverId: 4, hostId: 5},\r\n  ],\r\n  excludeHosts: [\r\n    {serverId: 2},\r\n    {serverId: 6, hostgroupId: 7},\r\n    {serverId: 8, hostId: 9},\r\n  ],\r\n};\r\nconsole.log($.param(exampleQuery));\r\n```\r\n","created_at":"2015-09-01T04:03:01Z","updated_at":"2015-09-04T08:56:47Z","closed_at":"2015-09-04T08:56:47Z","merged_at":"2015-09-04T08:56:47Z","merge_commit_sha":"22304df9476fe053249cdea55c5c0b4b15f1f12e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/project-hatohol/hatohol/pulls/1539/commits","review_comments_url":"https://api.github.com/repos/project-hatohol/hatohol/pulls/1539/comments","review_comment_url":"https://api.github.com/repos/project-hatohol/hatohol/pulls/comments{/number}","comments_url":"https://api.github.com/repos/project-hatohol/hatohol/issues/1539/comments","statuses_url":"https://api.github.com/repos/project-hatohol/hatohol/statuses/1d6b0fc328f9fc1f2622f505e1bea17257b3e8f7","head":{"label":"project-hatohol:rest-api-hosts-filter-2","ref":"rest-api-hosts-filter-2","sha":"1d6b0fc328f9fc1f2622f505e1bea17257b3e8f7","user":{"login":"project-hatohol","id":4715745,"avatar_url":"https://avatars.githubusercontent.com/u/4715745?v=3","gravatar_id":"","url":"https://api.github.com/users/project-hatohol","html_url":"https://github.com/project-hatohol","followers_url":"https://api.github.com/users/project-hatohol/followers","following_url":"https://api.github.com/users/project-hatohol/following{/other_user}","gists_url":"https://api.github.com/users/project-hatohol/gists{/gist_id}","starred_url":"https://api.github.com/users/project-hatohol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/project-hatohol/subscriptions","organizations_url":"https://api.github.com/users/project-hatohol/orgs","repos_url":"https://api.github.com/users/project-hatohol/repos","events_url":"https://api.github.com/users/project-hatohol/events{/privacy}","received_events_url":"https://api.github.com/users/project-hatohol/received_events","type":"Organization","site_admin":false},"repo":{"id":10903163,"name":"hatohol","full_name":"project-hatohol/hatohol","owner":{"login":"project-hatohol","id":4715745,"avatar_url":"https://avatars.githubusercontent.com/u/4715745?v=3","gravatar_id":"","url":"https://api.github.com/users/project-hatohol","html_url":"https://github.com/project-hatohol","followers_url":"https://api.github.com/users/project-hatohol/followers","following_url":"https://api.github.com/users/project-hatohol/following{/other_user}","gists_url":"https://api.github.com/users/project-hatohol/gists{/gist_id}","starred_url":"https://api.github.com/users/project-hatohol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/project-hatohol/subscriptions","organizations_url":"https://api.github.com/users/project-hatohol/orgs","repos_url":"https://api.github.com/users/project-hatohol/repos","events_url":"https://api.github.com/users/project-hatohol/events{/privacy}","received_events_url":"https://api.github.com/users/project-hatohol/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/project-hatohol/hatohol","description":"A unified manager of monitoring software","fork":false,"url":"https://api.github.com/repos/project-hatohol/hatohol","forks_url":"https://api.github.com/repos/project-hatohol/hatohol/forks","keys_url":"https://api.github.com/repos/project-hatohol/hatohol/keys{/key_id}","collaborators_url":"https://api.github.com/repos/project-hatohol/hatohol/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/project-hatohol/hatohol/teams","hooks_url":"https://api.github.com/repos/project-hatohol/hatohol/hooks","issue_events_url":"https://api.github.com/repos/project-hatohol/hatohol/issues/events{/number}","events_url":"https://api.github.com/repos/project-hatohol/hatohol/events","assignees_url":"https://api.github.com/repos/project-hatohol/hatohol/assignees{/user}","branches_url":"https://api.github.com/repos/project-hatohol/hatohol/branches{/branch}","tags_url":"https://api.github.com/repos/project-hatohol/hatohol/tags","blobs_url":"https://api.github.com/repos/project-hatohol/hatohol/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/project-hatohol/hatohol/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/project-hatohol/hatohol/git/refs{/sha}","trees_url":"https://api.github.com/repos/project-hatohol/hatohol/git/trees{/sha}","statuses_url":"https://api.github.com/repos/project-hatohol/hatohol/statuses/{sha}","languages_url":"https://api.github.com/repos/project-hatohol/hatohol/languages","stargazers_url":"https://api.github.com/repos/project-hatohol/hatohol/stargazers","contributors_url":"https://api.github.com/repos/project-hatohol/hatohol/contributors","subscribers_url":"https://api.github.com/repos/project-hatohol/hatohol/subscribers","subscription_url":"https://api.github.com/repos/project-hatohol/hatohol/subscription","commits_url":"https://api.github.com/repos/project-hatohol/hatohol/commits{/sha}","git_commits_url":"https://api.github.com/repos/project-hatohol/hatohol/git/commits{/sha}","comments_url":"https://api.github.com/repos/project-hatohol/hatohol/comments{/number}","issue_comment_url":"https://api.github.com/repos/project-hatohol/hatohol/issues/comments{/number}","contents_url":"https://api.github.com/repos/project-hatohol/hatohol/contents/{+path}","compare_url":"https://api.github.com/repos/project-hatohol/hatohol/compare/{base}...{head}","merges_url":"https://api.github.com/repos/project-hatohol/hatohol/merges","archive_url":"https://api.github.com/repos/project-hatohol/hatohol/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/project-hatohol/hatohol/downloads","issues_url":"https://api.github.com/repos/project-hatohol/hatohol/issues{/number}","pulls_url":"https://api.github.com/repos/project-hatohol/hatohol/pulls{/number}","milestones_url":"https://api.github.com/repos/project-hatohol/hatohol/milestones{/number}","notifications_url":"https://api.github.com/repos/project-hatohol/hatohol/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/project-hatohol/hatohol/labels{/name}","releases_url":"https://api.github.com/repos/project-hatohol/hatohol/releases{/id}","created_at":"2013-06-24T08:45:56Z","updated_at":"2015-08-03T08:45:17Z","pushed_at":"2015-09-04T08:56:47Z","git_url":"git://github.com/project-hatohol/hatohol.git","ssh_url":"git@github.com:project-hatohol/hatohol.git","clone_url":"https://github.com/project-hatohol/hatohol.git","svn_url":"https://github.com/project-hatohol/hatohol","homepage":"http://www.hatohol.org/","size":56746,"stargazers_count":69,"watchers_count":69,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":28,"mirror_url":null,"open_issues_count":96,"forks":28,"open_issues":96,"watchers":69,"default_branch":"master"}},"base":{"label":"project-hatohol:master","ref":"master","sha":"26dab2ec60f6958d636d531e0c1c3cecd89879b9","user":{"login":"project-hatohol","id":4715745,"avatar_url":"https://avatars.githubusercontent.com/u/4715745?v=3","gravatar_id":"","url":"https://api.github.com/users/project-hatohol","html_url":"https://github.com/project-hatohol","followers_url":"https://api.github.com/users/project-hatohol/followers","following_url":"https://api.github.com/users/project-hatohol/following{/other_user}","gists_url":"https://api.github.com/users/project-hatohol/gists{/gist_id}","starred_url":"https://api.github.com/users/project-hatohol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/project-hatohol/subscriptions","organizations_url":"https://api.github.com/users/project-hatohol/orgs","repos_url":"https://api.github.com/users/project-hatohol/repos","events_url":"https://api.github.com/users/project-hatohol/events{/privacy}","received_events_url":"https://api.github.com/users/project-hatohol/received_events","type":"Organization","site_admin":false},"repo":{"id":10903163,"name":"hatohol","full_name":"project-hatohol/hatohol","owner":{"login":"project-hatohol","id":4715745,"avatar_url":"https://avatars.githubusercontent.com/u/4715745?v=3","gravatar_id":"","url":"https://api.github.com/users/project-hatohol","html_url":"https://github.com/project-hatohol","followers_url":"https://api.github.com/users/project-hatohol/followers","following_url":"https://api.github.com/users/project-hatohol/following{/other_user}","gists_url":"https://api.github.com/users/project-hatohol/gists{/gist_id}","starred_url":"https://api.github.com/users/project-hatohol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/project-hatohol/subscriptions","organizations_url":"https://api.github.com/users/project-hatohol/orgs","repos_url":"https://api.github.com/users/project-hatohol/repos","events_url":"https://api.github.com/users/project-hatohol/events{/privacy}","received_events_url":"https://api.github.com/users/project-hatohol/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/project-hatohol/hatohol","description":"A unified manager of monitoring software","fork":false,"url":"https://api.github.com/repos/project-hatohol/hatohol","forks_url":"https://api.github.com/repos/project-hatohol/hatohol/forks","keys_url":"https://api.github.com/repos/project-hatohol/hatohol/keys{/key_id}","collaborators_url":"https://api.github.com/repos/project-hatohol/hatohol/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/project-hatohol/hatohol/teams","hooks_url":"https://api.github.com/repos/project-hatohol/hatohol/hooks","issue_events_url":"https://api.github.com/repos/project-hatohol/hatohol/issues/events{/number}","events_url":"https://api.github.com/repos/project-hatohol/hatohol/events","assignees_url":"https://api.github.com/repos/project-hatohol/hatohol/assignees{/user}","branches_url":"https://api.github.com/repos/project-hatohol/hatohol/branches{/branch}","tags_url":"https://api.github.com/repos/project-hatohol/hatohol/tags","blobs_url":"https://api.github.com/repos/project-hatohol/hatohol/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/project-hatohol/hatohol/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/project-hatohol/hatohol/git/refs{/sha}","trees_url":"https://api.github.com/repos/project-hatohol/hatohol/git/trees{/sha}","statuses_url":"https://api.github.com/repos/project-hatohol/hatohol/statuses/{sha}","languages_url":"https://api.github.com/repos/project-hatohol/hatohol/languages","stargazers_url":"https://api.github.com/repos/project-hatohol/hatohol/stargazers","contributors_url":"https://api.github.com/repos/project-hatohol/hatohol/contributors","subscribers_url":"https://api.github.com/repos/project-hatohol/hatohol/subscribers","subscription_url":"https://api.github.com/repos/project-hatohol/hatohol/subscription","commits_url":"https://api.github.com/repos/project-hatohol/hatohol/commits{/sha}","git_commits_url":"https://api.github.com/repos/project-hatohol/hatohol/git/commits{/sha}","comments_url":"https://api.github.com/repos/project-hatohol/hatohol/comments{/number}","issue_comment_url":"https://api.github.com/repos/project-hatohol/hatohol/issues/comments{/number}","contents_url":"https://api.github.com/repos/project-hatohol/hatohol/contents/{+path}","compare_url":"https://api.github.com/repos/project-hatohol/hatohol/compare/{base}...{head}","merges_url":"https://api.github.com/repos/project-hatohol/hatohol/merges","archive_url":"https://api.github.com/repos/project-hatohol/hatohol/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/project-hatohol/hatohol/downloads","issues_url":"https://api.github.com/repos/project-hatohol/hatohol/issues{/number}","pulls_url":"https://api.github.com/repos/project-hatohol/hatohol/pulls{/number}","milestones_url":"https://api.github.com/repos/project-hatohol/hatohol/milestones{/number}","notifications_url":"https://api.github.com/repos/project-hatohol/hatohol/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/project-hatohol/hatohol/labels{/name}","releases_url":"https://api.github.com/repos/project-hatohol/hatohol/releases{/id}","created_at":"2013-06-24T08:45:56Z","updated_at":"2015-08-03T08:45:17Z","pushed_at":"2015-09-04T08:56:47Z","git_url":"git://github.com/project-hatohol/hatohol.git","ssh_url":"git@github.com:project-hatohol/hatohol.git","clone_url":"https://github.com/project-hatohol/hatohol.git","svn_url":"https://github.com/project-hatohol/hatohol","homepage":"http://www.hatohol.org/","size":56746,"stargazers_count":69,"watchers_count":69,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":28,"mirror_url":null,"open_issues_count":96,"forks":28,"open_issues":96,"watchers":69,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/project-hatohol/hatohol/pulls/1539"},"html":{"href":"https://github.com/project-hatohol/hatohol/pull/1539"},"issue":{"href":"https://api.github.com/repos/project-hatohol/hatohol/issues/1539"},"comments":{"href":"https://api.github.com/repos/project-hatohol/hatohol/issues/1539/comments"},"review_comments":{"href":"https://api.github.com/repos/project-hatohol/hatohol/pulls/1539/comments"},"review_comment":{"href":"https://api.github.com/repos/project-hatohol/hatohol/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/project-hatohol/hatohol/pulls/1539/commits"},"statuses":{"href":"https://api.github.com/repos/project-hatohol/hatohol/statuses/1d6b0fc328f9fc1f2622f505e1bea17257b3e8f7"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"kz0817","id":2610513,"avatar_url":"https://avatars.githubusercontent.com/u/2610513?v=3","gravatar_id":"","url":"https://api.github.com/users/kz0817","html_url":"https://github.com/kz0817","followers_url":"https://api.github.com/users/kz0817/followers","following_url":"https://api.github.com/users/kz0817/following{/other_user}","gists_url":"https://api.github.com/users/kz0817/gists{/gist_id}","starred_url":"https://api.github.com/users/kz0817/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kz0817/subscriptions","organizations_url":"https://api.github.com/users/kz0817/orgs","repos_url":"https://api.github.com/users/kz0817/repos","events_url":"https://api.github.com/users/kz0817/events{/privacy}","received_events_url":"https://api.github.com/users/kz0817/received_events","type":"User","site_admin":false},"comments":0,"review_comments":0,"commits":5,"additions":299,"deletions":0,"changed_files":2}}