Skip to content

list_finding_aggregations

list_finding_aggregations(
    aggregation_type: AggregationType,
    *,
    config_overrides: Optional[Inspector2ClientConfig] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[ListFindingAggregationsMaxResults] = None,
    account_ids: Optional[StringFilterList] = None,
    aggregation_request: Optional[AggregationRequest] = None,
) -> ListFindingAggregationsResponse

Lists aggregated finding data for your environment based on specific criteria.

Parameters:

  • aggregation_type (AggregationType) –

    The type of the aggregation request.

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

    A token to use for paginating results that are returned in the response. Set the value of this parameter to null for the first request to a list action. If your response returns more than the maxResults maximum value it will also return a nextToken value. For subsequent calls, use the nextToken value returned from the previous request to continue listing results after the first page.

  • max_results (Optional[ListFindingAggregationsMaxResults], default: None ) –

    The maximum number of results the response can return. If your request would return more than the maximum the response will return a nextToken value, use this value when you call the action again to get the remaining results.

  • account_ids (Optional[StringFilterList], default: None ) –

    The Amazon Web Services account IDs to retrieve finding aggregation data for.

  • aggregation_request (Optional[AggregationRequest], default: None ) –

    Details of the aggregation request that is used to filter your aggregation results.

Raises:

Source code in docs_src/capo_inspector2/_services/inspector2.py
def list_finding_aggregations(
    self,
    aggregation_type: "capo_inspector2.types.aggregation_type.AggregationType",
    *,
    config_overrides: Optional[Inspector2ClientConfig] = None,
    next_token: Optional["capo_inspector2.types.next_token.NextToken"] = None,
    max_results: Optional[
        "capo_inspector2.types.list_finding_aggregations_max_results.ListFindingAggregationsMaxResults"
    ] = None,
    account_ids: Optional[
        "capo_inspector2.types.string_filter_list.StringFilterList"
    ] = None,
    aggregation_request: Optional[
        "capo_inspector2.types.aggregation_request.AggregationRequest"
    ] = None,
) -> "capo_inspector2.types.list_finding_aggregations_response.ListFindingAggregationsResponse":
    """<p>Lists aggregated finding data for your environment based on specific criteria.</p>

    Args:
        aggregation_type: <p>The type of the aggregation request.</p>
        next_token: <p>A token to use for paginating results that are returned in the response. Set the value of this parameter to null for the first request to a list action. If your response returns more than the <code>maxResults</code> maximum value it will also return a <code>nextToken</code> value. For subsequent calls, use the <code>nextToken</code> value returned from the previous request to continue listing results after the first page.</p>
        max_results: <p>The maximum number of results the response can return. If your request would return more than the maximum the response will return a <code>nextToken</code> value, use this value when you call the action again to get the remaining results.</p>
        account_ids: <p>The Amazon Web Services account IDs to retrieve finding aggregation data for.</p>
        aggregation_request: <p>Details of the aggregation request that is used to filter your aggregation results.</p>

    Raises:
        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.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.
    """

    def _handler(
        req: "OperationRequest[capo_inspector2.types.list_finding_aggregations_request.ListFindingAggregationsRequest]",
    ) -> OperationResponse[
        "capo_inspector2.types.list_finding_aggregations_response.ListFindingAggregationsResponse"
    ]:
        import capo_inspector2._operations.inspector2.list_finding_aggregations

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListFindingAggregations")
    )
    input_: capo_inspector2.types.list_finding_aggregations_request.ListFindingAggregationsRequest = {
        "aggregation_type": aggregation_type
    }
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results
    if account_ids is not None:
        input_["account_ids"] = account_ids
    if aggregation_request is not None:
        input_["aggregation_request"] = aggregation_request

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