Return the data for a query with the Network Flow Monitor query interface. You specify the query that you want to return results for by providing a query ID and a monitor name. This query returns the top contributors for a specific monitor.
Create a query ID for this call by calling the corresponding API call to start the query, StartQueryMonitorTopContributors. Use the scope ID that was returned for your account by CreateScope.
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 call for the top contributors that you want to be returned.
Parameters:
-
monitor_name
(ResourceName)
–
-
query_id
(str)
–
The identifier for the query. A query ID is an internally-generated identifier for a specific query returned from an API call to create a query.
-
next_token
(Optional[str], default:
None
)
–
The token for the next set of results. You receive this token from a previous call.
-
max_results
(Optional[int], default:
None
)
–
The number of query results that you want to return with this call.
Raises:
Source code in docs_src/capo_networkflowmonitor/_services/async_network_flow_monitor.py
| async def get_query_results_monitor_top_contributors(
self,
monitor_name: "capo_networkflowmonitor.types.resource_name.ResourceName",
query_id: str,
*,
config_overrides: Optional[AsyncNetworkFlowMonitorClientConfig] = None,
next_token: Optional[str] = None,
max_results: Optional[int] = None,
) -> "capo_networkflowmonitor.types.get_query_results_monitor_top_contributors_output.GetQueryResultsMonitorTopContributorsOutput":
"""<p>Return the data for a query with the Network Flow Monitor query interface. You specify the query that you want to return results for by providing a query ID and a monitor name. This query returns the top contributors for a specific monitor.</p> <p>Create a query ID for this call by calling the corresponding API call to start the query, <code>StartQueryMonitorTopContributors</code>. Use the scope ID that was returned for your account by <code>CreateScope</code>.</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 call for the top contributors that you want to be returned.</p>
Args:
monitor_name: <p>The name of the monitor.</p>
query_id: <p>The identifier for the query. A query ID is an internally-generated identifier for a specific query returned from an API call to create a query.</p>
next_token: <p>The token for the next set of results. You receive this token from a previous call.</p>
max_results: <p>The number of query results that you want to return with this call.</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.get_query_results_monitor_top_contributors_input.GetQueryResultsMonitorTopContributorsInput]",
) -> AsyncOperationResponse[
"capo_networkflowmonitor.types.get_query_results_monitor_top_contributors_output.GetQueryResultsMonitorTopContributorsOutput"
]:
import capo_networkflowmonitor._operations.network_flow_monitor.get_query_results_monitor_top_contributors
(
output,
http_response,
) = await capo_networkflowmonitor._operations.network_flow_monitor.get_query_results_monitor_top_contributors.async_get_query_results_monitor_top_contributors(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetQueryResultsMonitorTopContributors")
)
input_: capo_networkflowmonitor.types.get_query_results_monitor_top_contributors_input.GetQueryResultsMonitorTopContributorsInput = {
"monitor_name": monitor_name,
"query_id": query_id,
}
if next_token is not None:
input_["next_token"] = next_token
if max_results is not None:
input_["max_results"] = max_results
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|