{"action":"created","comment":{"url":"https://api.github.com/repos/quipucords/qpc/pulls/comments/237132462","pull_request_review_id":179352614,"id":237132462,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNzEzMjQ2Mg==","diff_hunk":"@@ -0,0 +1,104 @@\n+#!/usr/bin/env python\n+#\n+# Copyright (c) 2018 Red Hat, Inc.\n+#\n+# This software is licensed to you under the GNU General Public License,\n+# version 3 (GPLv3). There is NO WARRANTY for this software, express or\n+# implied, including the implied warranties of MERCHANTABILITY or FITNESS\n+# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv3\n+# along with this software; if not, see\n+# https://www.gnu.org/licenses/gpl-3.0.txt.\n+#\n+\"\"\"ReportDownloadCommand is used to download all reports.\"\"\"\n+\n+from __future__ import print_function\n+\n+import sys\n+\n+from qpc import messages, report, scan\n+from qpc.clicommand import CliCommand\n+from qpc.request import GET, request\n+from qpc.translation import _\n+from qpc.utils import (validate_write_file,\n+                       write_file)\n+\n+from requests import codes\n+\n+\n+# pylint: disable=too-few-public-methods\n+class ReportDownloadCommand(CliCommand):\n+    \"\"\"Defines the report download command.\n+\n+    This command is for downloading all reports.\n+    \"\"\"\n+\n+    SUBCOMMAND = report.SUBCOMMAND\n+    ACTION = report.DOWNLOAD\n+\n+    def __init__(self, subparsers):\n+        \"\"\"Create command.\"\"\"\n+        # pylint: disable=no-member\n+        CliCommand.__init__(self, self.SUBCOMMAND, self.ACTION,\n+                            subparsers.add_parser(self.ACTION), GET,\n+                            report.REPORT_URI, [codes.ok])\n+        id_group = self.parser.add_mutually_exclusive_group(required=True)\n+        id_group.add_argument('--scan-job', dest='scan_job_id',\n+                              metavar='SCAN_JOB_ID',\n+                              help=_(messages.REPORT_SCAN_JOB_ID_HELP))\n+        id_group.add_argument('--report', dest='report_id',\n+                              metavar='REPORT_ID',\n+                              help=_(messages.REPORT_REPORT_ID_HELP))\n+        self.parser.add_argument('--output-file', dest='path', metavar='PATH',\n+                                 help=_(messages.REPORT_PATH_HELP),\n+                                 required=True)\n+        self.report_id = None\n+\n+    def _validate_args(self):\n+        self.req_headers = {'Accept': 'application/gzip'}\n+        try:\n+            validate_write_file(self.args.path, 'output-file')","path":"qpc/report/download.py","position":59,"original_position":59,"commit_id":"30c8ac4f12f8cb44514593a977a91b82aa0d0e09","original_commit_id":"30c8ac4f12f8cb44514593a977a91b82aa0d0e09","user":{"login":"kholdaway","id":32331547,"node_id":"MDQ6VXNlcjMyMzMxNTQ3","avatar_url":"https://avatars0.githubusercontent.com/u/32331547?v=4","gravatar_id":"","url":"https://api.github.com/users/kholdaway","html_url":"https://github.com/kholdaway","followers_url":"https://api.github.com/users/kholdaway/followers","following_url":"https://api.github.com/users/kholdaway/following{/other_user}","gists_url":"https://api.github.com/users/kholdaway/gists{/gist_id}","starred_url":"https://api.github.com/users/kholdaway/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kholdaway/subscriptions","organizations_url":"https://api.github.com/users/kholdaway/orgs","repos_url":"https://api.github.com/users/kholdaway/repos","events_url":"https://api.github.com/users/kholdaway/events{/privacy}","received_events_url":"https://api.github.com/users/kholdaway/received_events","type":"User","site_admin":false},"body":"Let's validate that they add the `tar.gz` extension to the file name.","created_at":"2018-11-28T15:29:26Z","updated_at":"2018-11-28T15:29:35Z","html_url":"https://github.com/quipucords/qpc/pull/28#discussion_r237132462","pull_request_url":"https://api.github.com/repos/quipucords/qpc/pulls/28","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/quipucords/qpc/pulls/comments/237132462"},"html":{"href":"https://github.com/quipucords/qpc/pull/28#discussion_r237132462"},"pull_request":{"href":"https://api.github.com/repos/quipucords/qpc/pulls/28"}}},"pull_request":{"url":"https://api.github.com/repos/quipucords/qpc/pulls/28","id":233707478,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMzNzA3NDc4","html_url":"https://github.com/quipucords/qpc/pull/28","diff_url":"https://github.com/quipucords/qpc/pull/28.diff","patch_url":"https://github.com/quipucords/qpc/pull/28.patch","issue_url":"https://api.github.com/repos/quipucords/qpc/issues/28","number":28,"state":"open","locked":false,"title":"Add qpc report download command to CLI","user":{"login":"myersCody","id":16995455,"node_id":"MDQ6VXNlcjE2OTk1NDU1","avatar_url":"https://avatars1.githubusercontent.com/u/16995455?v=4","gravatar_id":"","url":"https://api.github.com/users/myersCody","html_url":"https://github.com/myersCody","followers_url":"https://api.github.com/users/myersCody/followers","following_url":"https://api.github.com/users/myersCody/following{/other_user}","gists_url":"https://api.github.com/users/myersCody/gists{/gist_id}","starred_url":"https://api.github.com/users/myersCody/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/myersCody/subscriptions","organizations_url":"https://api.github.com/users/myersCody/orgs","repos_url":"https://api.github.com/users/myersCody/repos","events_url":"https://api.github.com/users/myersCody/events{/privacy}","received_events_url":"https://api.github.com/users/myersCody/received_events","type":"User","site_admin":false},"body":"Closes #25 ","created_at":"2018-11-26T21:47:38Z","updated_at":"2018-11-28T15:29:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4d5c278c9b66f76cf9cfe6ac3104bc6372f6c3a8","assignee":{"login":"myersCody","id":16995455,"node_id":"MDQ6VXNlcjE2OTk1NDU1","avatar_url":"https://avatars1.githubusercontent.com/u/16995455?v=4","gravatar_id":"","url":"https://api.github.com/users/myersCody","html_url":"https://github.com/myersCody","followers_url":"https://api.github.com/users/myersCody/followers","following_url":"https://api.github.com/users/myersCody/following{/other_user}","gists_url":"https://api.github.com/users/myersCody/gists{/gist_id}","starred_url":"https://api.github.com/users/myersCody/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/myersCody/subscriptions","organizations_url":"https://api.github.com/users/myersCody/orgs","repos_url":"https://api.github.com/users/myersCody/repos","events_url":"https://api.github.com/users/myersCody/events{/privacy}","received_events_url":"https://api.github.com/users/myersCody/received_events","type":"User","site_admin":false},"assignees":[{"login":"myersCody","id":16995455,"node_id":"MDQ6VXNlcjE2OTk1NDU1","avatar_url":"https://avatars1.githubusercontent.com/u/16995455?v=4","gravatar_id":"","url":"https://api.github.com/users/myersCody","html_url":"https://github.com/myersCody","followers_url":"https://api.github.com/users/myersCody/followers","following_url":"https://api.github.com/users/myersCody/following{/other_user}","gists_url":"https://api.github.com/users/myersCody/gists{/gist_id}","starred_url":"https://api.github.com/users/myersCody/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/myersCody/subscriptions","organizations_url":"https://api.github.com/users/myersCody/orgs","repos_url":"https://api.github.com/users/myersCody/repos","events_url":"https://api.github.com/users/myersCody/events{/privacy}","received_events_url":"https://api.github.com/users/myersCody/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"abaiken","id":34656858,"node_id":"MDQ6VXNlcjM0NjU2ODU4","avatar_url":"https://avatars0.githubusercontent.com/u/34656858?v=4","gravatar_id":"","url":"https://api.github.com/users/abaiken","html_url":"https://github.com/abaiken","followers_url":"https://api.github.com/users/abaiken/followers","following_url":"https://api.github.com/users/abaiken/following{/other_user}","gists_url":"https://api.github.com/users/abaiken/gists{/gist_id}","starred_url":"https://api.github.com/users/abaiken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abaiken/subscriptions","organizations_url":"https://api.github.com/users/abaiken/orgs","repos_url":"https://api.github.com/users/abaiken/repos","events_url":"https://api.github.com/users/abaiken/events{/privacy}","received_events_url":"https://api.github.com/users/abaiken/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/quipucords/qpc/pulls/28/commits","review_comments_url":"https://api.github.com/repos/quipucords/qpc/pulls/28/comments","review_comment_url":"https://api.github.com/repos/quipucords/qpc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/quipucords/qpc/issues/28/comments","statuses_url":"https://api.github.com/repos/quipucords/qpc/statuses/30c8ac4f12f8cb44514593a977a91b82aa0d0e09","head":{"label":"quipucords:issues/25","ref":"issues/25","sha":"30c8ac4f12f8cb44514593a977a91b82aa0d0e09","user":{"login":"quipucords","id":29148065,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI5MTQ4MDY1","avatar_url":"https://avatars0.githubusercontent.com/u/29148065?v=4","gravatar_id":"","url":"https://api.github.com/users/quipucords","html_url":"https://github.com/quipucords","followers_url":"https://api.github.com/users/quipucords/followers","following_url":"https://api.github.com/users/quipucords/following{/other_user}","gists_url":"https://api.github.com/users/quipucords/gists{/gist_id}","starred_url":"https://api.github.com/users/quipucords/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quipucords/subscriptions","organizations_url":"https://api.github.com/users/quipucords/orgs","repos_url":"https://api.github.com/users/quipucords/repos","events_url":"https://api.github.com/users/quipucords/events{/privacy}","received_events_url":"https://api.github.com/users/quipucords/received_events","type":"Organization","site_admin":false},"repo":{"id":155544509,"node_id":"MDEwOlJlcG9zaXRvcnkxNTU1NDQ1MDk=","name":"qpc","full_name":"quipucords/qpc","private":false,"owner":{"login":"quipucords","id":29148065,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI5MTQ4MDY1","avatar_url":"https://avatars0.githubusercontent.com/u/29148065?v=4","gravatar_id":"","url":"https://api.github.com/users/quipucords","html_url":"https://github.com/quipucords","followers_url":"https://api.github.com/users/quipucords/followers","following_url":"https://api.github.com/users/quipucords/following{/other_user}","gists_url":"https://api.github.com/users/quipucords/gists{/gist_id}","starred_url":"https://api.github.com/users/quipucords/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quipucords/subscriptions","organizations_url":"https://api.github.com/users/quipucords/orgs","repos_url":"https://api.github.com/users/quipucords/repos","events_url":"https://api.github.com/users/quipucords/events{/privacy}","received_events_url":"https://api.github.com/users/quipucords/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/quipucords/qpc","description":"A tool for discovery, inspection, collection/deduplication, and reporting on an IT environment","fork":false,"url":"https://api.github.com/repos/quipucords/qpc","forks_url":"https://api.github.com/repos/quipucords/qpc/forks","keys_url":"https://api.github.com/repos/quipucords/qpc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/quipucords/qpc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/quipucords/qpc/teams","hooks_url":"https://api.github.com/repos/quipucords/qpc/hooks","issue_events_url":"https://api.github.com/repos/quipucords/qpc/issues/events{/number}","events_url":"https://api.github.com/repos/quipucords/qpc/events","assignees_url":"https://api.github.com/repos/quipucords/qpc/assignees{/user}","branches_url":"https://api.github.com/repos/quipucords/qpc/branches{/branch}","tags_url":"https://api.github.com/repos/quipucords/qpc/tags","blobs_url":"https://api.github.com/repos/quipucords/qpc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/quipucords/qpc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/quipucords/qpc/git/refs{/sha}","trees_url":"https://api.github.com/repos/quipucords/qpc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/quipucords/qpc/statuses/{sha}","languages_url":"https://api.github.com/repos/quipucords/qpc/languages","stargazers_url":"https://api.github.com/repos/quipucords/qpc/stargazers","contributors_url":"https://api.github.com/repos/quipucords/qpc/contributors","subscribers_url":"https://api.github.com/repos/quipucords/qpc/subscribers","subscription_url":"https://api.github.com/repos/quipucords/qpc/subscription","commits_url":"https://api.github.com/repos/quipucords/qpc/commits{/sha}","git_commits_url":"https://api.github.com/repos/quipucords/qpc/git/commits{/sha}","comments_url":"https://api.github.com/repos/quipucords/qpc/comments{/number}","issue_comment_url":"https://api.github.com/repos/quipucords/qpc/issues/comments{/number}","contents_url":"https://api.github.com/repos/quipucords/qpc/contents/{+path}","compare_url":"https://api.github.com/repos/quipucords/qpc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/quipucords/qpc/merges","archive_url":"https://api.github.com/repos/quipucords/qpc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/quipucords/qpc/downloads","issues_url":"https://api.github.com/repos/quipucords/qpc/issues{/number}","pulls_url":"https://api.github.com/repos/quipucords/qpc/pulls{/number}","milestones_url":"https://api.github.com/repos/quipucords/qpc/milestones{/number}","notifications_url":"https://api.github.com/repos/quipucords/qpc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/quipucords/qpc/labels{/name}","releases_url":"https://api.github.com/repos/quipucords/qpc/releases{/id}","deployments_url":"https://api.github.com/repos/quipucords/qpc/deployments","created_at":"2018-10-31T11:14:07Z","updated_at":"2018-11-27T20:25:12Z","pushed_at":"2018-11-27T20:28:19Z","git_url":"git://github.com/quipucords/qpc.git","ssh_url":"git@github.com:quipucords/qpc.git","clone_url":"https://github.com/quipucords/qpc.git","svn_url":"https://github.com/quipucords/qpc","homepage":"http://qpc.readthedocs.io","size":139,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"quipucords:master","ref":"master","sha":"90f63b8ca7820f5d03f3b23e2720950bdb550cb9","user":{"login":"quipucords","id":29148065,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI5MTQ4MDY1","avatar_url":"https://avatars0.githubusercontent.com/u/29148065?v=4","gravatar_id":"","url":"https://api.github.com/users/quipucords","html_url":"https://github.com/quipucords","followers_url":"https://api.github.com/users/quipucords/followers","following_url":"https://api.github.com/users/quipucords/following{/other_user}","gists_url":"https://api.github.com/users/quipucords/gists{/gist_id}","starred_url":"https://api.github.com/users/quipucords/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quipucords/subscriptions","organizations_url":"https://api.github.com/users/quipucords/orgs","repos_url":"https://api.github.com/users/quipucords/repos","events_url":"https://api.github.com/users/quipucords/events{/privacy}","received_events_url":"https://api.github.com/users/quipucords/received_events","type":"Organization","site_admin":false},"repo":{"id":155544509,"node_id":"MDEwOlJlcG9zaXRvcnkxNTU1NDQ1MDk=","name":"qpc","full_name":"quipucords/qpc","private":false,"owner":{"login":"quipucords","id":29148065,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI5MTQ4MDY1","avatar_url":"https://avatars0.githubusercontent.com/u/29148065?v=4","gravatar_id":"","url":"https://api.github.com/users/quipucords","html_url":"https://github.com/quipucords","followers_url":"https://api.github.com/users/quipucords/followers","following_url":"https://api.github.com/users/quipucords/following{/other_user}","gists_url":"https://api.github.com/users/quipucords/gists{/gist_id}","starred_url":"https://api.github.com/users/quipucords/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quipucords/subscriptions","organizations_url":"https://api.github.com/users/quipucords/orgs","repos_url":"https://api.github.com/users/quipucords/repos","events_url":"https://api.github.com/users/quipucords/events{/privacy}","received_events_url":"https://api.github.com/users/quipucords/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/quipucords/qpc","description":"A tool for discovery, inspection, collection/deduplication, and reporting on an IT environment","fork":false,"url":"https://api.github.com/repos/quipucords/qpc","forks_url":"https://api.github.com/repos/quipucords/qpc/forks","keys_url":"https://api.github.com/repos/quipucords/qpc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/quipucords/qpc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/quipucords/qpc/teams","hooks_url":"https://api.github.com/repos/quipucords/qpc/hooks","issue_events_url":"https://api.github.com/repos/quipucords/qpc/issues/events{/number}","events_url":"https://api.github.com/repos/quipucords/qpc/events","assignees_url":"https://api.github.com/repos/quipucords/qpc/assignees{/user}","branches_url":"https://api.github.com/repos/quipucords/qpc/branches{/branch}","tags_url":"https://api.github.com/repos/quipucords/qpc/tags","blobs_url":"https://api.github.com/repos/quipucords/qpc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/quipucords/qpc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/quipucords/qpc/git/refs{/sha}","trees_url":"https://api.github.com/repos/quipucords/qpc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/quipucords/qpc/statuses/{sha}","languages_url":"https://api.github.com/repos/quipucords/qpc/languages","stargazers_url":"https://api.github.com/repos/quipucords/qpc/stargazers","contributors_url":"https://api.github.com/repos/quipucords/qpc/contributors","subscribers_url":"https://api.github.com/repos/quipucords/qpc/subscribers","subscription_url":"https://api.github.com/repos/quipucords/qpc/subscription","commits_url":"https://api.github.com/repos/quipucords/qpc/commits{/sha}","git_commits_url":"https://api.github.com/repos/quipucords/qpc/git/commits{/sha}","comments_url":"https://api.github.com/repos/quipucords/qpc/comments{/number}","issue_comment_url":"https://api.github.com/repos/quipucords/qpc/issues/comments{/number}","contents_url":"https://api.github.com/repos/quipucords/qpc/contents/{+path}","compare_url":"https://api.github.com/repos/quipucords/qpc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/quipucords/qpc/merges","archive_url":"https://api.github.com/repos/quipucords/qpc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/quipucords/qpc/downloads","issues_url":"https://api.github.com/repos/quipucords/qpc/issues{/number}","pulls_url":"https://api.github.com/repos/quipucords/qpc/pulls{/number}","milestones_url":"https://api.github.com/repos/quipucords/qpc/milestones{/number}","notifications_url":"https://api.github.com/repos/quipucords/qpc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/quipucords/qpc/labels{/name}","releases_url":"https://api.github.com/repos/quipucords/qpc/releases{/id}","deployments_url":"https://api.github.com/repos/quipucords/qpc/deployments","created_at":"2018-10-31T11:14:07Z","updated_at":"2018-11-27T20:25:12Z","pushed_at":"2018-11-27T20:28:19Z","git_url":"git://github.com/quipucords/qpc.git","ssh_url":"git@github.com:quipucords/qpc.git","clone_url":"https://github.com/quipucords/qpc.git","svn_url":"https://github.com/quipucords/qpc","homepage":"http://qpc.readthedocs.io","size":139,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/quipucords/qpc/pulls/28"},"html":{"href":"https://github.com/quipucords/qpc/pull/28"},"issue":{"href":"https://api.github.com/repos/quipucords/qpc/issues/28"},"comments":{"href":"https://api.github.com/repos/quipucords/qpc/issues/28/comments"},"review_comments":{"href":"https://api.github.com/repos/quipucords/qpc/pulls/28/comments"},"review_comment":{"href":"https://api.github.com/repos/quipucords/qpc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/quipucords/qpc/pulls/28/commits"},"statuses":{"href":"https://api.github.com/repos/quipucords/qpc/statuses/30c8ac4f12f8cb44514593a977a91b82aa0d0e09"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"kholdaway"}}