Skip to content

list_anomalies_for_insight

list_anomalies_for_insight(
    insight_id: InsightId,
    *,
    config_overrides: Optional[DevOpsGuruClientConfig] = None,
    start_time_range: Optional[StartTimeRange] = None,
    max_results: Optional[ListAnomaliesForInsightMaxResults] = None,
    next_token: Optional[UuidNextToken] = None,
    account_id: Optional[AwsAccountId] = None,
    filters: Optional[ListAnomaliesForInsightFilters] = None,
) -> ListAnomaliesForInsightResponse

Returns a list of the anomalies that belong to an insight that you specify using its ID.

Parameters:

  • insight_id (InsightId) –

    The ID of the insight. The returned anomalies belong to this insight.

  • start_time_range (Optional[StartTimeRange], default: None ) –

    A time range used to specify when the requested anomalies started. All returned anomalies started during this time range.

  • max_results (Optional[ListAnomaliesForInsightMaxResults], 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.

  • account_id (Optional[AwsAccountId], default: None ) –

    The ID of the Amazon Web Services account.

  • filters (Optional[ListAnomaliesForInsightFilters], default: None ) –

    Specifies one or more service names that are used to list anomalies.

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.

  • ResourceNotFoundException –

    A requested resource could not be found

  • 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_anomalies_for_insight(
    self,
    insight_id: "capo_devops_guru.types.insight_id.InsightId",
    *,
    config_overrides: Optional[DevOpsGuruClientConfig] = None,
    start_time_range: Optional[
        "capo_devops_guru.types.start_time_range.StartTimeRange"
    ] = None,
    max_results: Optional[
        "capo_devops_guru.types.list_anomalies_for_insight_max_results.ListAnomaliesForInsightMaxResults"
    ] = None,
    next_token: Optional[
        "capo_devops_guru.types.uuid_next_token.UuidNextToken"
    ] = None,
    account_id: Optional[
        "capo_devops_guru.types.aws_account_id.AwsAccountId"
    ] = None,
    filters: Optional[
        "capo_devops_guru.types.list_anomalies_for_insight_filters.ListAnomaliesForInsightFilters"
    ] = None,
) -> "capo_devops_guru.types.list_anomalies_for_insight_response.ListAnomaliesForInsightResponse":
    """<p> Returns a list of the anomalies that belong to an insight that you specify using its ID. </p>

    Args:
        insight_id: <p> The ID of the insight. The returned anomalies belong to this insight. </p>
        start_time_range: <p> A time range used to specify when the requested anomalies started. All returned anomalies started during this time range. </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>
        account_id: <p>The ID of the Amazon Web Services account. </p>
        filters: <p> Specifies one or more service names that are used to list anomalies. </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.resource_not_found_exception.ResourceNotFoundException: <p>A requested resource could not be found</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_anomalies_for_insight_request.ListAnomaliesForInsightRequest]",
    ) -> OperationResponse[
        "capo_devops_guru.types.list_anomalies_for_insight_response.ListAnomaliesForInsightResponse"
    ]:
        import capo_devops_guru._operations.capstone_control_plane_service.list_anomalies_for_insight

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListAnomaliesForInsight")
    )
    input_: capo_devops_guru.types.list_anomalies_for_insight_request.ListAnomaliesForInsightRequest = {
        "insight_id": insight_id
    }
    if start_time_range is not None:
        input_["start_time_range"] = start_time_range
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token
    if account_id is not None:
        input_["account_id"] = account_id
    if filters is not None:
        input_["filters"] = filters

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