Skip to content

list_insights

list_insights(
    status_filter: ListInsightsStatusFilter,
    *,
    config_overrides: Optional[DevOpsGuruClientConfig] = None,
    max_results: Optional[ListInsightsMaxResults] = None,
    next_token: Optional[UuidNextToken] = None,
) -> ListInsightsResponse

Returns a list of insights in your Amazon Web Services account. You can specify which insights are returned by their start time and status (ONGOING, CLOSED, or ANY).

Parameters:

  • status_filter (ListInsightsStatusFilter) –

    A filter used to filter the returned insights by their status. You can specify one status filter.

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

    The maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned nextToken value.

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

    The pagination token to use to retrieve the next page of results for this operation. If this value is null, it retrieves the first page.

Raises:

  • AccessDeniedException –

    You don't have permissions to perform the requested operation. The user or role that is making the request must have at least one IAM permissions policy attached that grants the required permissions. For more information, see Access Management in the IAM User Guide.

  • InternalServerException –

    An internal failure in an Amazon service occurred.

  • ThrottlingException –

    The request was denied due to a request throttling.

  • ValidationException –

    Contains information about data passed in to a field during a request that is not valid.

  • UnknownServiceError –

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

Source code in docs_src/capo_devops_guru/_services/dev_ops_guru.py
def list_insights(
    self,
    status_filter: "capo_devops_guru.types.list_insights_status_filter.ListInsightsStatusFilter",
    *,
    config_overrides: Optional[DevOpsGuruClientConfig] = None,
    max_results: Optional[
        "capo_devops_guru.types.list_insights_max_results.ListInsightsMaxResults"
    ] = None,
    next_token: Optional[
        "capo_devops_guru.types.uuid_next_token.UuidNextToken"
    ] = None,
) -> "capo_devops_guru.types.list_insights_response.ListInsightsResponse":
    """<p> Returns a list of insights in your Amazon Web Services account. You can specify which insights are returned by their start time and status (<code>ONGOING</code>, <code>CLOSED</code>, or <code>ANY</code>). </p>

    Args:
        status_filter: <p> A filter used to filter the returned insights by their status. You can specify one status filter. </p>
        max_results: <p>The maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned <code>nextToken</code> value.</p>
        next_token: <p>The pagination token to use to retrieve the next page of results for this operation. If this value is null, it retrieves the first page.</p>

    Raises:
        capo_devops_guru.errors.access_denied_exception.AccessDeniedException: <p> You don't have permissions to perform the requested operation. The user or role that is making the request must have at least one IAM permissions policy attached that grants the required permissions. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html">Access Management</a> in the <i>IAM User Guide</i>. </p>
        capo_devops_guru.errors.internal_server_exception.InternalServerException: <p>An internal failure in an Amazon service occurred.</p>
        capo_devops_guru.errors.throttling_exception.ThrottlingException: <p>The request was denied due to a request throttling.</p>
        capo_devops_guru.errors.validation_exception.ValidationException: <p> Contains information about data passed in to a field during a request that is not valid. </p>
        capo_devops_guru.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_devops_guru.types.list_insights_request.ListInsightsRequest]",
    ) -> OperationResponse[
        "capo_devops_guru.types.list_insights_response.ListInsightsResponse"
    ]:
        import capo_devops_guru._operations.capstone_control_plane_service.list_insights

        output, http_response = (
            capo_devops_guru._operations.capstone_control_plane_service.list_insights.list_insights(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListInsights")
    )
    input_: capo_devops_guru.types.list_insights_request.ListInsightsRequest = {
        "status_filter": status_filter
    }
    if max_results is not None:
        input_["max_results"] = max_results
    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