{"action":"created","comment":{"url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments/50031292","id":50031292,"diff_hunk":"@@ -18,5 +18,25 @@ def create_resource_provision_requests(type, _id, data)\n       MiqProvisionVirtWorkflow.from_ws(version_str, @auth_user_obj, template_fields, vm_fields, requester, tags,\n                                        additional_values, ems_custom_attrs, miq_custom_attrs)\n     end\n+\n+    def deny_resource_provision_requests(type, id, data)\n+      provreq = resource_search(id, type, collection_class(:provision_requests))\n+      provreq.deny(@auth_user, data['reason'])\n+      res = action_result(true, \"Provision request #{id} denied\")\n+      add_href_to_result(res, type, id)","path":"app/controllers/api_controller/provision_requests.rb","position":9,"original_position":9,"commit_id":"343422fd2b0cead560e4625b82b1ef72232828ce","original_commit_id":"343422fd2b0cead560e4625b82b1ef72232828ce","user":{"login":"romaintb","id":102168,"avatar_url":"https://avatars.githubusercontent.com/u/102168?v=3","gravatar_id":"","url":"https://api.github.com/users/romaintb","html_url":"https://github.com/romaintb","followers_url":"https://api.github.com/users/romaintb/followers","following_url":"https://api.github.com/users/romaintb/following{/other_user}","gists_url":"https://api.github.com/users/romaintb/gists{/gist_id}","starred_url":"https://api.github.com/users/romaintb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romaintb/subscriptions","organizations_url":"https://api.github.com/users/romaintb/orgs","repos_url":"https://api.github.com/users/romaintb/repos","events_url":"https://api.github.com/users/romaintb/events{/privacy}","received_events_url":"https://api.github.com/users/romaintb/received_events","type":"User","site_admin":false},"body":"@abellotti not proud of this one, can you share some light on why this is not automatic ? would be a great help :)","created_at":"2016-01-18T18:38:01Z","updated_at":"2016-01-18T18:38:01Z","html_url":"https://github.com/ManageIQ/manageiq/pull/5999#discussion_r50031292","pull_request_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/5999","_links":{"self":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments/50031292"},"html":{"href":"https://github.com/ManageIQ/manageiq/pull/5999#discussion_r50031292"},"pull_request":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/5999"}}},"pull_request":{"url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/5999","id":54659011,"html_url":"https://github.com/ManageIQ/manageiq/pull/5999","diff_url":"https://github.com/ManageIQ/manageiq/pull/5999.diff","patch_url":"https://github.com/ManageIQ/manageiq/pull/5999.patch","issue_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/5999","number":5999,"state":"open","locked":false,"title":"expose approve/deny a provision_request in the API","user":{"login":"romaintb","id":102168,"avatar_url":"https://avatars.githubusercontent.com/u/102168?v=3","gravatar_id":"","url":"https://api.github.com/users/romaintb","html_url":"https://github.com/romaintb","followers_url":"https://api.github.com/users/romaintb/followers","following_url":"https://api.github.com/users/romaintb/following{/other_user}","gists_url":"https://api.github.com/users/romaintb/gists{/gist_id}","starred_url":"https://api.github.com/users/romaintb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romaintb/subscriptions","organizations_url":"https://api.github.com/users/romaintb/orgs","repos_url":"https://api.github.com/users/romaintb/repos","events_url":"https://api.github.com/users/romaintb/events{/privacy}","received_events_url":"https://api.github.com/users/romaintb/received_events","type":"User","site_admin":false},"body":"Hi guys,\r\n\r\nI guess this one is for @abellotti .\r\nWe found ourselves in the need for approving/denying a provision_request via the API.\r\nThis PR is not done yet (no tests at least).\r\nWould you guys be ok with something like this ?\r\n\r\nThanks !","created_at":"2015-12-28T14:35:18Z","updated_at":"2016-01-18T18:38:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4c4a41ad4c39021b9446191fab1f4ffe823cd8db","assignee":{"login":"abellotti","id":5797328,"avatar_url":"https://avatars.githubusercontent.com/u/5797328?v=3","gravatar_id":"","url":"https://api.github.com/users/abellotti","html_url":"https://github.com/abellotti","followers_url":"https://api.github.com/users/abellotti/followers","following_url":"https://api.github.com/users/abellotti/following{/other_user}","gists_url":"https://api.github.com/users/abellotti/gists{/gist_id}","starred_url":"https://api.github.com/users/abellotti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abellotti/subscriptions","organizations_url":"https://api.github.com/users/abellotti/orgs","repos_url":"https://api.github.com/users/abellotti/repos","events_url":"https://api.github.com/users/abellotti/events{/privacy}","received_events_url":"https://api.github.com/users/abellotti/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/5999/commits","review_comments_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/5999/comments","review_comment_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/5999/comments","statuses_url":"https://api.github.com/repos/ManageIQ/manageiq/statuses/343422fd2b0cead560e4625b82b1ef72232828ce","head":{"label":"romaintb:api_request_approval","ref":"api_request_approval","sha":"343422fd2b0cead560e4625b82b1ef72232828ce","user":{"login":"romaintb","id":102168,"avatar_url":"https://avatars.githubusercontent.com/u/102168?v=3","gravatar_id":"","url":"https://api.github.com/users/romaintb","html_url":"https://github.com/romaintb","followers_url":"https://api.github.com/users/romaintb/followers","following_url":"https://api.github.com/users/romaintb/following{/other_user}","gists_url":"https://api.github.com/users/romaintb/gists{/gist_id}","starred_url":"https://api.github.com/users/romaintb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romaintb/subscriptions","organizations_url":"https://api.github.com/users/romaintb/orgs","repos_url":"https://api.github.com/users/romaintb/repos","events_url":"https://api.github.com/users/romaintb/events{/privacy}","received_events_url":"https://api.github.com/users/romaintb/received_events","type":"User","site_admin":false},"repo":{"id":47756791,"name":"manageiq","full_name":"romaintb/manageiq","owner":{"login":"romaintb","id":102168,"avatar_url":"https://avatars.githubusercontent.com/u/102168?v=3","gravatar_id":"","url":"https://api.github.com/users/romaintb","html_url":"https://github.com/romaintb","followers_url":"https://api.github.com/users/romaintb/followers","following_url":"https://api.github.com/users/romaintb/following{/other_user}","gists_url":"https://api.github.com/users/romaintb/gists{/gist_id}","starred_url":"https://api.github.com/users/romaintb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romaintb/subscriptions","organizations_url":"https://api.github.com/users/romaintb/orgs","repos_url":"https://api.github.com/users/romaintb/repos","events_url":"https://api.github.com/users/romaintb/events{/privacy}","received_events_url":"https://api.github.com/users/romaintb/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/romaintb/manageiq","description":"ManageIQ Cloud Management Platform","fork":true,"url":"https://api.github.com/repos/romaintb/manageiq","forks_url":"https://api.github.com/repos/romaintb/manageiq/forks","keys_url":"https://api.github.com/repos/romaintb/manageiq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/romaintb/manageiq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/romaintb/manageiq/teams","hooks_url":"https://api.github.com/repos/romaintb/manageiq/hooks","issue_events_url":"https://api.github.com/repos/romaintb/manageiq/issues/events{/number}","events_url":"https://api.github.com/repos/romaintb/manageiq/events","assignees_url":"https://api.github.com/repos/romaintb/manageiq/assignees{/user}","branches_url":"https://api.github.com/repos/romaintb/manageiq/branches{/branch}","tags_url":"https://api.github.com/repos/romaintb/manageiq/tags","blobs_url":"https://api.github.com/repos/romaintb/manageiq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/romaintb/manageiq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/romaintb/manageiq/git/refs{/sha}","trees_url":"https://api.github.com/repos/romaintb/manageiq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/romaintb/manageiq/statuses/{sha}","languages_url":"https://api.github.com/repos/romaintb/manageiq/languages","stargazers_url":"https://api.github.com/repos/romaintb/manageiq/stargazers","contributors_url":"https://api.github.com/repos/romaintb/manageiq/contributors","subscribers_url":"https://api.github.com/repos/romaintb/manageiq/subscribers","subscription_url":"https://api.github.com/repos/romaintb/manageiq/subscription","commits_url":"https://api.github.com/repos/romaintb/manageiq/commits{/sha}","git_commits_url":"https://api.github.com/repos/romaintb/manageiq/git/commits{/sha}","comments_url":"https://api.github.com/repos/romaintb/manageiq/comments{/number}","issue_comment_url":"https://api.github.com/repos/romaintb/manageiq/issues/comments{/number}","contents_url":"https://api.github.com/repos/romaintb/manageiq/contents/{+path}","compare_url":"https://api.github.com/repos/romaintb/manageiq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/romaintb/manageiq/merges","archive_url":"https://api.github.com/repos/romaintb/manageiq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/romaintb/manageiq/downloads","issues_url":"https://api.github.com/repos/romaintb/manageiq/issues{/number}","pulls_url":"https://api.github.com/repos/romaintb/manageiq/pulls{/number}","milestones_url":"https://api.github.com/repos/romaintb/manageiq/milestones{/number}","notifications_url":"https://api.github.com/repos/romaintb/manageiq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/romaintb/manageiq/labels{/name}","releases_url":"https://api.github.com/repos/romaintb/manageiq/releases{/id}","created_at":"2015-12-10T11:11:34Z","updated_at":"2015-12-10T11:11:50Z","pushed_at":"2016-01-18T18:35:44Z","git_url":"git://github.com/romaintb/manageiq.git","ssh_url":"git@github.com:romaintb/manageiq.git","clone_url":"https://github.com/romaintb/manageiq.git","svn_url":"https://github.com/romaintb/manageiq","homepage":"manageiq.org","size":100074,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"ManageIQ:master","ref":"master","sha":"83871151c8191ddc88f7a13b705d3ce9f2c4a414","user":{"login":"ManageIQ","id":1125575,"avatar_url":"https://avatars.githubusercontent.com/u/1125575?v=3","gravatar_id":"","url":"https://api.github.com/users/ManageIQ","html_url":"https://github.com/ManageIQ","followers_url":"https://api.github.com/users/ManageIQ/followers","following_url":"https://api.github.com/users/ManageIQ/following{/other_user}","gists_url":"https://api.github.com/users/ManageIQ/gists{/gist_id}","starred_url":"https://api.github.com/users/ManageIQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ManageIQ/subscriptions","organizations_url":"https://api.github.com/users/ManageIQ/orgs","repos_url":"https://api.github.com/users/ManageIQ/repos","events_url":"https://api.github.com/users/ManageIQ/events{/privacy}","received_events_url":"https://api.github.com/users/ManageIQ/received_events","type":"Organization","site_admin":false},"repo":{"id":20789757,"name":"manageiq","full_name":"ManageIQ/manageiq","owner":{"login":"ManageIQ","id":1125575,"avatar_url":"https://avatars.githubusercontent.com/u/1125575?v=3","gravatar_id":"","url":"https://api.github.com/users/ManageIQ","html_url":"https://github.com/ManageIQ","followers_url":"https://api.github.com/users/ManageIQ/followers","following_url":"https://api.github.com/users/ManageIQ/following{/other_user}","gists_url":"https://api.github.com/users/ManageIQ/gists{/gist_id}","starred_url":"https://api.github.com/users/ManageIQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ManageIQ/subscriptions","organizations_url":"https://api.github.com/users/ManageIQ/orgs","repos_url":"https://api.github.com/users/ManageIQ/repos","events_url":"https://api.github.com/users/ManageIQ/events{/privacy}","received_events_url":"https://api.github.com/users/ManageIQ/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ManageIQ/manageiq","description":"ManageIQ Cloud Management Platform","fork":false,"url":"https://api.github.com/repos/ManageIQ/manageiq","forks_url":"https://api.github.com/repos/ManageIQ/manageiq/forks","keys_url":"https://api.github.com/repos/ManageIQ/manageiq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ManageIQ/manageiq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ManageIQ/manageiq/teams","hooks_url":"https://api.github.com/repos/ManageIQ/manageiq/hooks","issue_events_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/events{/number}","events_url":"https://api.github.com/repos/ManageIQ/manageiq/events","assignees_url":"https://api.github.com/repos/ManageIQ/manageiq/assignees{/user}","branches_url":"https://api.github.com/repos/ManageIQ/manageiq/branches{/branch}","tags_url":"https://api.github.com/repos/ManageIQ/manageiq/tags","blobs_url":"https://api.github.com/repos/ManageIQ/manageiq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ManageIQ/manageiq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ManageIQ/manageiq/git/refs{/sha}","trees_url":"https://api.github.com/repos/ManageIQ/manageiq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ManageIQ/manageiq/statuses/{sha}","languages_url":"https://api.github.com/repos/ManageIQ/manageiq/languages","stargazers_url":"https://api.github.com/repos/ManageIQ/manageiq/stargazers","contributors_url":"https://api.github.com/repos/ManageIQ/manageiq/contributors","subscribers_url":"https://api.github.com/repos/ManageIQ/manageiq/subscribers","subscription_url":"https://api.github.com/repos/ManageIQ/manageiq/subscription","commits_url":"https://api.github.com/repos/ManageIQ/manageiq/commits{/sha}","git_commits_url":"https://api.github.com/repos/ManageIQ/manageiq/git/commits{/sha}","comments_url":"https://api.github.com/repos/ManageIQ/manageiq/comments{/number}","issue_comment_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/comments{/number}","contents_url":"https://api.github.com/repos/ManageIQ/manageiq/contents/{+path}","compare_url":"https://api.github.com/repos/ManageIQ/manageiq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ManageIQ/manageiq/merges","archive_url":"https://api.github.com/repos/ManageIQ/manageiq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ManageIQ/manageiq/downloads","issues_url":"https://api.github.com/repos/ManageIQ/manageiq/issues{/number}","pulls_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls{/number}","milestones_url":"https://api.github.com/repos/ManageIQ/manageiq/milestones{/number}","notifications_url":"https://api.github.com/repos/ManageIQ/manageiq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ManageIQ/manageiq/labels{/name}","releases_url":"https://api.github.com/repos/ManageIQ/manageiq/releases{/id}","created_at":"2014-06-13T02:31:26Z","updated_at":"2016-01-16T14:45:07Z","pushed_at":"2016-01-18T18:35:45Z","git_url":"git://github.com/ManageIQ/manageiq.git","ssh_url":"git@github.com:ManageIQ/manageiq.git","clone_url":"https://github.com/ManageIQ/manageiq.git","svn_url":"https://github.com/ManageIQ/manageiq","homepage":"manageiq.org","size":136158,"stargazers_count":192,"watchers_count":192,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":208,"mirror_url":null,"open_issues_count":517,"forks":208,"open_issues":517,"watchers":192,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/5999"},"html":{"href":"https://github.com/ManageIQ/manageiq/pull/5999"},"issue":{"href":"https://api.github.com/repos/ManageIQ/manageiq/issues/5999"},"comments":{"href":"https://api.github.com/repos/ManageIQ/manageiq/issues/5999/comments"},"review_comments":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/5999/comments"},"review_comment":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/5999/commits"},"statuses":{"href":"https://api.github.com/repos/ManageIQ/manageiq/statuses/343422fd2b0cead560e4625b82b1ef72232828ce"}}}}