Skip to content

start_query_performance_monitor async

start_query_performance_monitor(
    monitor_name: ResourceName,
    start_time: datetime,
    end_time: datetime,
    query_type: PerformanceMonitorQueryType,
    *,
    config_overrides: Optional[AsyncNetworkFlowMonitorClientConfig] = None,
    filter_parameters: Optional[FilterParameters] = None,
    limit: Optional[QueryLimit] = None,
) -> StartQueryPerformanceMonitorOutput

Create a query that you can use with the Network Flow Monitor query interface to return the top paths for a performance monitor. Specify the performance monitor that you want to create the query for.

The call returns a query ID that you can use with GetQueryResultsPerformanceMonitor to return the results of the query.

Top paths in Network Flow Monitor are the network paths used by the traffic for the resources that a performance monitor tracks, ranked by impact score and then by traffic volume. Each path includes the traffic and round-trip time for the path, together with a breakdown of the subnet pairs that the path includes.

Parameters:

  • monitor_name (ResourceName) –

    The name of the performance monitor.

  • 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.

  • query_type (PerformanceMonitorQueryType) –

    The type of query that you want to create. Specify TOP_PATHS to return the top paths for the performance monitor.

  • filter_parameters (Optional[FilterParameters], default: None ) –

    The filters for the query, to return a subset of the top paths. For a TOP_PATHS query, you can filter on the following fields:

    • local_az_id: The Availability Zone ID of the local end of a path

    • remote_az_id: The Availability Zone ID of the remote end of a path

    • impact_level: The impact level of a path

    When you filter on impact_level, Network Flow Monitor compares the filter with the most severe impact level for the path over the time period of the query, and the traffic and round-trip time that Network Flow Monitor returns for each path still cover the full time period. Paths that have no impact data don't match an impact_level filter, including a NOT_EQUALS filter. Network Flow Monitor doesn't filter the subnet pairs within a path by impact level.

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

    The maximum number of top paths that you want the query to return.

Raises:

Source code in docs_src/capo_networkflowmonitor/_services/async_network_flow_monitor.py
async def start_query_performance_monitor(
    self,
    monitor_name: "capo_networkflowmonitor.types.resource_name.ResourceName",
    start_time: datetime.datetime,
    end_time: datetime.datetime,
    query_type: "capo_networkflowmonitor.types.performance_monitor_query_type.PerformanceMonitorQueryType",
    *,
    config_overrides: Optional[AsyncNetworkFlowMonitorClientConfig] = None,
    filter_parameters: Optional[
        "capo_networkflowmonitor.types.filter_parameters.FilterParameters"
    ] = None,
    limit: Optional["capo_networkflowmonitor.types.query_limit.QueryLimit"] = None,
) -> "capo_networkflowmonitor.types.start_query_performance_monitor_output.StartQueryPerformanceMonitorOutput":
    """<p>Create a query that you can use with the Network Flow Monitor query interface to return the top paths for a performance monitor. Specify the performance monitor that you want to create the 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_GetQueryResultsPerformanceMonitor.html"> GetQueryResultsPerformanceMonitor</a> to return the results of the query.</p> <p>Top paths in Network Flow Monitor are the network paths used by the traffic for the resources that a performance monitor tracks, ranked by impact score and then by traffic volume. Each path includes the traffic and round-trip time for the path, together with a breakdown of the subnet pairs that the path includes.</p>

    Args:
        monitor_name: <p>The name of the performance monitor.</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>
        query_type: <p>The type of query that you want to create. Specify <code>TOP_PATHS</code> to return the top paths for the performance monitor.</p>
        filter_parameters: <p>The filters for the query, to return a subset of the top paths. For a <code>TOP_PATHS</code> query, you can filter on the following fields:</p> <ul> <li> <p> <code>local_az_id</code>: The Availability Zone ID of the local end of a path</p> </li> <li> <p> <code>remote_az_id</code>: The Availability Zone ID of the remote end of a path</p> </li> <li> <p> <code>impact_level</code>: The impact level of a path</p> </li> </ul> <p>When you filter on <code>impact_level</code>, Network Flow Monitor compares the filter with the most severe impact level for the path over the time period of the query, and the traffic and round-trip time that Network Flow Monitor returns for each path still cover the full time period. Paths that have no impact data don't match an <code>impact_level</code> filter, including a <code>NOT_EQUALS</code> filter. Network Flow Monitor doesn't filter the subnet pairs within a path by impact level.</p>
        limit: <p>The maximum number of top paths that you want the query 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.resource_not_found_exception.ResourceNotFoundException: <p>The request specifies a resource that doesn't exist.</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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_networkflowmonitor.types.start_query_performance_monitor_input.StartQueryPerformanceMonitorInput]",
    ) -> AsyncOperationResponse[
        "capo_networkflowmonitor.types.start_query_performance_monitor_output.StartQueryPerformanceMonitorOutput"
    ]:
        import capo_networkflowmonitor._operations.network_flow_monitor.start_query_performance_monitor

        (
            output,
            http_response,
        ) = await capo_networkflowmonitor._operations.network_flow_monitor.start_query_performance_monitor.async_start_query_performance_monitor(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StartQueryPerformanceMonitor")
    )
    input_: capo_networkflowmonitor.types.start_query_performance_monitor_input.StartQueryPerformanceMonitorInput = {
        "monitor_name": monitor_name,
        "start_time": start_time,
        "end_time": end_time,
        "query_type": query_type,
    }
    if filter_parameters is not None:
        input_["filter_parameters"] = filter_parameters
    if limit is not None:
        input_["limit"] = limit

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output