Skip to content

CloudTrailClient.list_insights_metric_data

rboto-cloudtrail==0.4.0 · Service index · Types

Model summary (excerpt): Returns Insights metrics data for trails that have enabled Insights. The request must include the EventSource , EventName , and InsightType parameters. If the InsightType is set to ApiErrorRateInsight , the request must also include the ErrorCode parameter. The following are the available time periods for ListInsightsMetricData . Each cutoff is inclusive. Data points with a period of 60...

Install and imports

python -m pip install "rboto[cloudtrail]==0.4.0"
from rboto import CloudTrailClient
from rboto_cloudtrail.types import (
    InsightType,
    InsightsMetricDataType,
    ListInsightsMetricDataOutput,
)

Signature

async def list_insights_metric_data(
    *,
    event_source: str,
    event_name: str,
    insight_type: InsightType,
    trail_name: str | None = None,
    error_code: str | None = None,
    start_time: str | None = None,
    end_time: str | None = None,
    period: int | None = None,
    data_type: InsightsMetricDataType | None = None,
    max_results: int | None = None,
    next_token: str | None = None,
) -> ListInsightsMetricDataOutput: ...

Arguments without defaults are required. None omits an optional request argument. Static types do not validate resource existence, permissions, lengths, ranges, or conditional service requirements.

Arguments

Argument Required Model notes (excerpt)
event_source Yes The Amazon Web Services service to which the request was made, such as iam.amazonaws.com or s3.amazonaws.com .
event_name Yes The name of the event, typically the Amazon Web Services API on which unusual levels of activity were recorded.
insight_type Yes The type of CloudTrail Insights event, which is either ApiCallRateInsight or ApiErrorRateInsight . The ApiCallRateInsight Insights type analyzes write-only management API calls that are aggregated per minute against a baseline API call volume. The ApiErrorRateInsight Insights type analyzes management API calls that result in error codes.
trail_name No The Amazon Resource Name(ARN) or name of the trail for which you want to retrieve Insights metrics data. This parameter should only be provided to fetch Insights metrics data generated on trails logging data events. This parameter is not required for Insights metric data generated on trails logging management events.
error_code No Conditionally required if the InsightType parameter is set to ApiErrorRateInsight . If returning metrics for the ApiErrorRateInsight Insights type, this is the error to retrieve data for. For example, AccessDenied .
start_time No Specifies, in UTC, the start time for time-series data. The value specified is inclusive; results include data points with the specified time stamp. The default is 90 days before the time of request.
end_time No Specifies, in UTC, the end time for time-series data. The value specified is exclusive; results include data points up to the specified time stamp. The default is the time of request.
period No Granularity of data to retrieve, in seconds. Valid values are 60 , 300 , and 3600 . If you specify any other value, you will get an error. The default is 3600 seconds.
data_type No Type of data points to return. Valid values are NonZeroData and FillWithZeros . The default is NonZeroData .
max_results No The maximum number of data points to return. Valid values are integers from 1 to 21600. The default value is 21600.
next_token No Returned if all datapoints can't be returned in a single call. For example, due to reaching MaxResults . Add this parameter to the request to continue retrieving results starting from the last evaluated point.

Output

ListInsightsMetricDataOutput.

Read-only native attributes, accessed as response.field. Collection getters materialize Python values; to_dict() recursively materializes a mapping. Streams are consumed once.

Field Type Presence References
trail_arn str | None Always present —
event_source str | None Always present —
event_name str | None Always present —
insight_type InsightTypeOutput | None Always present InsightTypeOutput
error_code str | None Always present —
timestamps list[str] | None Always present —
values list[float] | None Always present —
next_token str | None Always present —

| None means a value can be absent. Output mappings include every declared key; optional input keys may be omitted. Unknown output enum/union variants are not automatically valid inputs.

InsightType, InsightsMetricDataType, ListInsightsMetricDataOutput

Follow these links for nested inputs and outputs; recursive types link back to the same type page.

Pagination and streaming

client.paginators.list_insights_metric_data(...) accepts the same arguments and returns AsyncIterator[ListInsightsMetricDataOutput]. Direct calls return one page. Pages preserve the Output representation above.

Input cursors: next_token. Page-size argument: max_results.

No output stream.

Errors

Import from rboto_cloudtrail.exceptions:

InvalidParameterError, InvalidTrailNameError, OperationNotPermittedError, UnsupportedOperationError.

Other service failures use the service base error; credential, transport and timeout failures use shared errors.

Service guide · Pinned model