Skip to content

start_query_workload_insights_top_contributors

start_query_workload_insights_top_contributors(
    scope_id: ScopeId,
    start_time: datetime,
    end_time: datetime,
    metric_name: WorkloadInsightsMetric,
    destination_category: DestinationCategory,
    *,
    config_overrides: Optional[NetworkFlowMonitorClientConfig] = None,
    limit: Optional[Limit] = None,
) -> StartQueryWorkloadInsightsTopContributorsOutput

Create a query with the Network Flow Monitor query interface that you can run to return workload insights top contributors. Specify the scope that you want to create a query for.

The call returns a query ID that you can use with GetQueryResultsWorkloadInsightsTopContributors to run the query and return the top contributors for the workload insights for a scope.

Top contributors in Network Flow Monitor are network flows with the highest values for a specific metric type. Top contributors can be across all workload insights, for a given scope, or for a specific monitor. Use the applicable APIs for the top contributors that you want to be returned.

Parameters:

  • scope_id (ScopeId) –

    The identifier for the scope that includes the resources you want to get data results for. A scope ID is an internally-generated identifier that includes all the resources for a specific root account. A scope ID is returned from a CreateScope API call.

  • start_time (datetime) –

    The timestamp that is the date and time that is the beginning of the period that you want to retrieve results for with your query.

  • end_time (datetime) –

    The timestamp that is the date and time end of the period that you want to retrieve results for with your query.

  • metric_name (WorkloadInsightsMetric) –

    The metric that you want to query top contributors for. That is, you can specify this metric to return the top contributor network flows, for this type of metric, for a monitor and (optionally) within a specific category, such as network flows between Availability Zones.

  • destination_category (DestinationCategory) –

    The destination category for a top contributors row. Destination categories can be one of the following:

    • INTRA_AZ: Top contributor network flows within a single Availability Zone

    • INTER_AZ: Top contributor network flows between Availability Zones

    • INTER_REGION: Top contributor network flows between Regions (to the edge of another Region)

    • INTER_VPC: Top contributor network flows between VPCs

    • AWS_SERVICES: Top contributor network flows to or from Amazon Web Services services

    • UNCLASSIFIED: Top contributor network flows that do not have a bucket classification

  • limit (Optional[Limit], default: None ) –

    The maximum number of top contributors to return.

Raises:

Source code in docs_src/capo_networkflowmonitor/_services/network_flow_monitor.py
def start_query_workload_insights_top_contributors(
    self,
    scope_id: "capo_networkflowmonitor.types.scope_id.ScopeId",
    start_time: datetime.datetime,
    end_time: datetime.datetime,
    metric_name: "capo_networkflowmonitor.types.workload_insights_metric.WorkloadInsightsMetric",
    destination_category: "capo_networkflowmonitor.types.destination_category.DestinationCategory",
    *,
    config_overrides: Optional[NetworkFlowMonitorClientConfig] = None,
    limit: Optional["capo_networkflowmonitor.types.limit.Limit"] = None,
) -> "capo_networkflowmonitor.types.start_query_workload_insights_top_contributors_output.StartQueryWorkloadInsightsTopContributorsOutput":
    """<p>Create a query with the Network Flow Monitor query interface that you can run to return workload insights top contributors. Specify the scope that you want to create a query for.</p> <p>The call returns a query ID that you can use with <a href="https://docs.aws.amazon.com/networkflowmonitor/2.0/APIReference/API_GetQueryResultsWorkloadInsightsTopContributors.html"> GetQueryResultsWorkloadInsightsTopContributors</a> to run the query and return the top contributors for the workload insights for a scope.</p> <p>Top contributors in Network Flow Monitor are network flows with the highest values for a specific metric type. Top contributors can be across all workload insights, for a given scope, or for a specific monitor. Use the applicable APIs for the top contributors that you want to be returned.</p>

    Args:
        scope_id: <p>The identifier for the scope that includes the resources you want to get data results for. A scope ID is an internally-generated identifier that includes all the resources for a specific root account. A scope ID is returned from a <code>CreateScope</code> API call.</p>
        start_time: <p>The timestamp that is the date and time that is the beginning of the period that you want to retrieve results for with your query.</p>
        end_time: <p>The timestamp that is the date and time end of the period that you want to retrieve results for with your query.</p>
        metric_name: <p>The metric that you want to query top contributors for. That is, you can specify this metric to return the top contributor network flows, for this type of metric, for a monitor and (optionally) within a specific category, such as network flows between Availability Zones.</p>
        destination_category: <p>The destination category for a top contributors row. Destination categories can be one of the following: </p> <ul> <li> <p> <code>INTRA_AZ</code>: Top contributor network flows within a single Availability Zone</p> </li> <li> <p> <code>INTER_AZ</code>: Top contributor network flows between Availability Zones</p> </li> <li> <p> <code>INTER_REGION</code>: Top contributor network flows between Regions (to the edge of another Region)</p> </li> <li> <p> <code>INTER_VPC</code>: Top contributor network flows between VPCs</p> </li> <li> <p> <code>AWS_SERVICES</code>: Top contributor network flows to or from Amazon Web Services services</p> </li> <li> <p> <code>UNCLASSIFIED</code>: Top contributor network flows that do not have a bucket classification</p> </li> </ul>
        limit: <p>The maximum number of top contributors to return.</p>

    Raises:
        capo_networkflowmonitor.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient permission to perform this action.</p>
        capo_networkflowmonitor.errors.internal_server_exception.InternalServerException: <p>An internal error occurred.</p>
        capo_networkflowmonitor.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request exceeded a service quota.</p>
        capo_networkflowmonitor.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_networkflowmonitor.errors.validation_exception.ValidationException: <p>Invalid request.</p>
        capo_networkflowmonitor.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_networkflowmonitor.types.start_query_workload_insights_top_contributors_input.StartQueryWorkloadInsightsTopContributorsInput]",
    ) -> OperationResponse[
        "capo_networkflowmonitor.types.start_query_workload_insights_top_contributors_output.StartQueryWorkloadInsightsTopContributorsOutput"
    ]:
        import capo_networkflowmonitor._operations.network_flow_monitor.start_query_workload_insights_top_contributors

        output, http_response = (
            capo_networkflowmonitor._operations.network_flow_monitor.start_query_workload_insights_top_contributors.start_query_workload_insights_top_contributors(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("StartQueryWorkloadInsightsTopContributors"),
    )
    input_: capo_networkflowmonitor.types.start_query_workload_insights_top_contributors_input.StartQueryWorkloadInsightsTopContributorsInput = {
        "scope_id": scope_id,
        "start_time": start_time,
        "end_time": end_time,
        "metric_name": metric_name,
        "destination_category": destination_category,
    }
    if limit is not None:
        input_["limit"] = limit

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