Skip to content

list_image_scan_finding_aggregations

list_image_scan_finding_aggregations(
    *,
    config_overrides: Optional[imagebuilderClientConfig] = None,
    filter: Optional[Filter] = None,
    next_token: Optional[PaginationToken] = None,
) -> ListImageScanFindingAggregationsResponse

Returns a list of image scan aggregations for your account. You can filter by the type of key that Image Builder uses to group results. For example, if you want to get a list of findings by severity level for one of your pipelines, you might specify your pipeline with the imagePipelineArn filter. If you don't specify a filter, Image Builder returns an aggregation for your account.

To streamline results, you can use the following filters in your request:

  • imageBuildVersionArn

  • imagePipelineArn

  • vulnerabilityId

Parameters:

  • filter (Optional[Filter], default: None ) –

    A filter name and value pair that determines the type of aggregation that Image Builder returns. Use one of the following filter names:

    • imageBuildVersionArn

    • imagePipelineArn

    • vulnerabilityId

    If you don't specify a filter, Image Builder returns an aggregation for your account.

  • next_token (Optional[PaginationToken], default: None ) –

    A token to specify where to start paginating. Use the nextToken value from a previously truncated response.

Raises:

  • CallRateLimitExceededException –

    You have exceeded the permitted request rate for the Amazon EC2 APIs that Image Builder calls on your behalf. Retry with an increasing or variable delay between requests.

  • ClientException –

    A generic client error. This error usually indicates that the request failed a validation check, such as when a downstream service rejects a configured value.

  • ForbiddenException –

    You are not authorized to perform the requested operation.

  • InvalidPaginationTokenException –

    You have provided an invalid pagination token in your request.

  • InvalidRequestException –

    The request is malformed or otherwise invalid. Verify the request and try again.

  • ServiceException –

    An internal server error occurred while Image Builder processed the request. Retrying the request may succeed.

  • ServiceUnavailableException –

    The service is unable to process your request at this time.

  • UnknownServiceError –

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

Examples:

List image scan finding aggregations for an image pipeline The following example aggregates vulnerability findings for images that the specified pipeline created, with counts grouped by severity level.

>>> client.list_image_scan_finding_aggregations(filter={'name': 'imagePipelineArn', 'values': ['arn:aws:imagebuilder:us-west-2:111122223333:image-pipeline/my-example-pipeline']})
Source code in docs_src/capo_imagebuilder/_services/imagebuilder.py
def list_image_scan_finding_aggregations(
    self,
    *,
    config_overrides: Optional[imagebuilderClientConfig] = None,
    filter: Optional["capo_imagebuilder.types.filter.Filter"] = None,
    next_token: Optional[
        "capo_imagebuilder.types.pagination_token.PaginationToken"
    ] = None,
) -> "capo_imagebuilder.types.list_image_scan_finding_aggregations_response.ListImageScanFindingAggregationsResponse":
    """<p>Returns a list of image scan aggregations for your account. You can filter by the type of key that Image Builder uses to group results. For example, if you want to get a list of findings by severity level for one of your pipelines, you might specify your pipeline with the <code>imagePipelineArn</code> filter. If you don't specify a filter, Image Builder returns an aggregation for your account.</p> <p>To streamline results, you can use the following filters in your request:</p> <ul> <li> <p> <code>imageBuildVersionArn</code> </p> </li> <li> <p> <code>imagePipelineArn</code> </p> </li> <li> <p> <code>vulnerabilityId</code> </p> </li> </ul>

    Args:
        filter: <p>A filter name and value pair that determines the type of aggregation that Image Builder returns. Use one of the following filter names:</p> <ul> <li> <p> <code>imageBuildVersionArn</code> </p> </li> <li> <p> <code>imagePipelineArn</code> </p> </li> <li> <p> <code>vulnerabilityId</code> </p> </li> </ul> <p>If you don't specify a filter, Image Builder returns an aggregation for your account.</p>
        next_token: <p>A token to specify where to start paginating. Use the <code>nextToken</code> value from a previously truncated response.</p>

    Raises:
        capo_imagebuilder.errors.call_rate_limit_exceeded_exception.CallRateLimitExceededException: <p>You have exceeded the permitted request rate for the Amazon EC2 APIs that Image Builder calls on your behalf. Retry with an increasing or variable delay between requests.</p>
        capo_imagebuilder.errors.client_exception.ClientException: <p>A generic client error. This error usually indicates that the request failed a validation check, such as when a downstream service rejects a configured value.</p>
        capo_imagebuilder.errors.forbidden_exception.ForbiddenException: <p>You are not authorized to perform the requested operation.</p>
        capo_imagebuilder.errors.invalid_pagination_token_exception.InvalidPaginationTokenException: <p>You have provided an invalid pagination token in your request.</p>
        capo_imagebuilder.errors.invalid_request_exception.InvalidRequestException: <p>The request is malformed or otherwise invalid. Verify the request and try again.</p>
        capo_imagebuilder.errors.service_exception.ServiceException: <p>An internal server error occurred while Image Builder processed the request. Retrying the request may succeed.</p>
        capo_imagebuilder.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service is unable to process your request at this time.</p>
        capo_imagebuilder.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        List image scan finding aggregations for an image pipeline
        The following example aggregates vulnerability findings for images that the specified pipeline created, with counts grouped by severity level.

        >>> client.list_image_scan_finding_aggregations(filter={'name': 'imagePipelineArn', 'values': ['arn:aws:imagebuilder:us-west-2:111122223333:image-pipeline/my-example-pipeline']})
    """

    def _handler(
        req: "OperationRequest[capo_imagebuilder.types.list_image_scan_finding_aggregations_request.ListImageScanFindingAggregationsRequest]",
    ) -> OperationResponse[
        "capo_imagebuilder.types.list_image_scan_finding_aggregations_response.ListImageScanFindingAggregationsResponse"
    ]:
        import capo_imagebuilder._operations.imagebuilder.list_image_scan_finding_aggregations

        output, http_response = (
            capo_imagebuilder._operations.imagebuilder.list_image_scan_finding_aggregations.list_image_scan_finding_aggregations(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListImageScanFindingAggregations")
    )
    input_: capo_imagebuilder.types.list_image_scan_finding_aggregations_request.ListImageScanFindingAggregationsRequest = {}
    if filter is not None:
        input_["filter"] = filter
    if next_token is not None:
        input_["next_token"] = next_token

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