Skip to content

get_cis_scan_report

get_cis_scan_report(
    scan_arn: CisScanArn,
    *,
    config_overrides: Optional[Inspector2ClientConfig] = None,
    target_accounts: Optional[ReportTargetAccounts] = None,
    report_format: Optional[CisReportFormat] = None,
) -> GetCisScanReportResponse

Retrieves a CIS scan report.

Parameters:

  • scan_arn (CisScanArn) –

    The scan ARN.

  • target_accounts (Optional[ReportTargetAccounts], default: None ) –

    The target accounts.

  • report_format (Optional[CisReportFormat], default: None ) –

    The format of the report. Valid values are PDF and CSV. If no value is specified, the report format defaults to PDF.

Raises:

  • AccessDeniedException –

    You do not have sufficient access to perform this action.

    For Enable, you receive this error if you attempt to use a feature in an unsupported Amazon Web Services Region.

  • InternalServerException –

    The request has failed due to an internal failure of the Amazon Inspector service.

  • ResourceNotFoundException –

    The operation tried to access an invalid resource. Make sure the resource is specified correctly.

  • ThrottlingException –

    The limit on the number of requests per second was exceeded.

  • ValidationException –

    The request has failed validation due to missing required fields or having invalid inputs.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Examples:

Sample GetCisScanReport Call

>>> client.get_cis_scan_report(scan_arn='arn:aws:inspector2:us-east-1:123412341234:owner/123412341234/cis-scan/624b746d-e080-44ae-8c1d-48e653365a38', report_format='PDF')
Source code in docs_src/capo_inspector2/_services/inspector2.py
def get_cis_scan_report(
    self,
    scan_arn: "capo_inspector2.types.cis_scan_arn.CisScanArn",
    *,
    config_overrides: Optional[Inspector2ClientConfig] = None,
    target_accounts: Optional[
        "capo_inspector2.types.report_target_accounts.ReportTargetAccounts"
    ] = None,
    report_format: Optional[
        "capo_inspector2.types.cis_report_format.CisReportFormat"
    ] = None,
) -> "capo_inspector2.types.get_cis_scan_report_response.GetCisScanReportResponse":
    """<p>Retrieves a CIS scan report.</p>

    Args:
        scan_arn: <p>The scan ARN.</p>
        target_accounts: <p>The target accounts.</p>
        report_format: <p> The format of the report. Valid values are <code>PDF</code> and <code>CSV</code>. If no value is specified, the report format defaults to <code>PDF</code>. </p>

    Raises:
        capo_inspector2.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p> <p> For <code>Enable</code>, you receive this error if you attempt to use a feature in an unsupported Amazon Web Services Region. </p>
        capo_inspector2.errors.internal_server_exception.InternalServerException: <p>The request has failed due to an internal failure of the Amazon Inspector service.</p>
        capo_inspector2.errors.resource_not_found_exception.ResourceNotFoundException: <p>The operation tried to access an invalid resource. Make sure the resource is specified correctly.</p>
        capo_inspector2.errors.throttling_exception.ThrottlingException: <p>The limit on the number of requests per second was exceeded.</p>
        capo_inspector2.errors.validation_exception.ValidationException: <p>The request has failed validation due to missing required fields or having invalid inputs.</p>
        capo_inspector2.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Sample GetCisScanReport Call

        >>> client.get_cis_scan_report(scan_arn='arn:aws:inspector2:us-east-1:123412341234:owner/123412341234/cis-scan/624b746d-e080-44ae-8c1d-48e653365a38', report_format='PDF')
    """

    def _handler(
        req: "OperationRequest[capo_inspector2.types.get_cis_scan_report_request.GetCisScanReportRequest]",
    ) -> OperationResponse[
        "capo_inspector2.types.get_cis_scan_report_response.GetCisScanReportResponse"
    ]:
        import capo_inspector2._operations.inspector2.get_cis_scan_report

        output, http_response = (
            capo_inspector2._operations.inspector2.get_cis_scan_report.get_cis_scan_report(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetCisScanReport")
    )
    input_: capo_inspector2.types.get_cis_scan_report_request.GetCisScanReportRequest = {
        "scan_arn": scan_arn
    }
    if target_accounts is not None:
        input_["target_accounts"] = target_accounts
    if report_format is not None:
        input_["report_format"] = report_format

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output