Skip to content

list_assessment_runs

list_assessment_runs(
    *,
    config_overrides: Optional[InspectorClientConfig] = None,
    assessment_template_arns: Optional[ListParentArnList] = None,
    filter: Optional[AssessmentRunFilter] = None,
    next_token: Optional[PaginationToken] = None,
    max_results: Optional[ListMaxResults] = None,
) -> ListAssessmentRunsResponse

Lists the assessment runs that correspond to the assessment templates that are specified by the ARNs of the assessment templates.

Parameters:

  • assessment_template_arns (Optional[ListParentArnList], default: None ) –

    The ARNs that specify the assessment templates whose assessment runs you want to list.

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

    You can use this parameter to specify a subset of data to be included in the action's response.

    For a record to match a filter, all specified filter attributes must match. When multiple values are specified for a filter attribute, any of the values can match.

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

    You can use this parameter when paginating results. Set the value of this parameter to null on your first call to the ListAssessmentRuns action. Subsequent calls to the action fill nextToken in the request with the value of NextToken from the previous response to continue listing data.

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

    You can use this parameter to indicate the maximum number of items that you want in the response. The default value is 10. The maximum value is 500.

Raises:

  • AccessDeniedException –

    You do not have required permissions to access the requested resource.

  • InternalException –

    Internal server error.

  • InvalidInputException –

    The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • NoSuchEntityException –

    The request was rejected because it referenced an entity that does not exist. The error code describes the entity.

  • UnknownServiceError –

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

Examples:

List assessment runs Lists the assessment runs that correspond to the assessment templates that are specified by the ARNs of the assessment templates.

>>> client.list_assessment_runs(assessment_template_arns=['arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw'], max_results=123)
Source code in docs_src/capo_inspector/_services/inspector.py
def list_assessment_runs(
    self,
    *,
    config_overrides: Optional[InspectorClientConfig] = None,
    assessment_template_arns: Optional[
        "capo_inspector.types.list_parent_arn_list.ListParentArnList"
    ] = None,
    filter: Optional[
        "capo_inspector.types.assessment_run_filter.AssessmentRunFilter"
    ] = None,
    next_token: Optional[
        "capo_inspector.types.pagination_token.PaginationToken"
    ] = None,
    max_results: Optional[
        "capo_inspector.types.list_max_results.ListMaxResults"
    ] = None,
) -> (
    "capo_inspector.types.list_assessment_runs_response.ListAssessmentRunsResponse"
):
    """<p>Lists the assessment runs that correspond to the assessment templates that are specified by the ARNs of the assessment templates.</p>

    Args:
        assessment_template_arns: <p>The ARNs that specify the assessment templates whose assessment runs you want to list.</p>
        filter: <p>You can use this parameter to specify a subset of data to be included in the action's response.</p> <p>For a record to match a filter, all specified filter attributes must match. When multiple values are specified for a filter attribute, any of the values can match.</p>
        next_token: <p>You can use this parameter when paginating results. Set the value of this parameter to null on your first call to the <b>ListAssessmentRuns</b> action. Subsequent calls to the action fill <b>nextToken</b> in the request with the value of <b>NextToken</b> from the previous response to continue listing data.</p>
        max_results: <p>You can use this parameter to indicate the maximum number of items that you want in the response. The default value is 10. The maximum value is 500.</p>

    Raises:
        capo_inspector.errors.access_denied_exception.AccessDeniedException: <p>You do not have required permissions to access the requested resource.</p>
        capo_inspector.errors.internal_exception.InternalException: <p>Internal server error.</p>
        capo_inspector.errors.invalid_input_exception.InvalidInputException: <p>The request was rejected because an invalid or out-of-range value was supplied for an input parameter.</p>
        capo_inspector.errors.no_such_entity_exception.NoSuchEntityException: <p>The request was rejected because it referenced an entity that does not exist. The error code describes the entity.</p>
        capo_inspector.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        List assessment runs
        Lists the assessment runs that correspond to the assessment templates that are specified by the ARNs of the assessment templates.

        >>> client.list_assessment_runs(assessment_template_arns=['arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw'], max_results=123)
    """

    def _handler(
        req: "OperationRequest[capo_inspector.types.list_assessment_runs_request.ListAssessmentRunsRequest]",
    ) -> OperationResponse[
        "capo_inspector.types.list_assessment_runs_response.ListAssessmentRunsResponse"
    ]:
        import capo_inspector._operations.inspector_service.list_assessment_runs

        output, http_response = (
            capo_inspector._operations.inspector_service.list_assessment_runs.list_assessment_runs(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListAssessmentRuns")
    )
    input_: capo_inspector.types.list_assessment_runs_request.ListAssessmentRunsRequest = {}
    if assessment_template_arns is not None:
        input_["assessment_template_arns"] = assessment_template_arns
    if filter is not None:
        input_["filter"] = filter
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

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