Return the data for a query with the Amazon CloudWatch Internet Monitor query interface. Specify the query that you want to return results for by providing a QueryId and a monitor name.
For more information about using the query interface, including examples, see Using the Amazon CloudWatch Internet Monitor query interface in the Amazon CloudWatch Internet Monitor User Guide.
Parameters:
-
monitor_name
(ResourceName)
–
The name of the monitor to return data for.
-
query_id
(str)
–
The ID of the query that you want to return data results for. A QueryId is an internally-generated identifier for a specific 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[QueryMaxResults], default:
None
)
–
The number of query results that you want to return with this call.
Raises:
Source code in docs_src/capo_internetmonitor/_services/internet_monitor.py
| def get_query_results(
self,
monitor_name: "capo_internetmonitor.types.resource_name.ResourceName",
query_id: str,
*,
config_overrides: Optional[InternetMonitorClientConfig] = None,
next_token: Optional[str] = None,
max_results: Optional[
"capo_internetmonitor.types.query_max_results.QueryMaxResults"
] = None,
) -> "capo_internetmonitor.types.get_query_results_output.GetQueryResultsOutput":
"""<p>Return the data for a query with the Amazon CloudWatch Internet Monitor query interface. Specify the query that you want to return results for by providing a <code>QueryId</code> and a monitor name.</p> <p>For more information about using the query interface, including examples, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-IM-view-cw-tools-cwim-query.html">Using the Amazon CloudWatch Internet Monitor query interface</a> in the Amazon CloudWatch Internet Monitor User Guide.</p>
Args:
monitor_name: <p>The name of the monitor to return data for.</p>
query_id: <p>The ID of the query that you want to return data results for. A <code>QueryId</code> is an internally-generated identifier for a specific 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_internetmonitor.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient permission to perform this action.</p>
capo_internetmonitor.errors.internal_server_exception.InternalServerException: <p>An internal error occurred.</p>
capo_internetmonitor.errors.limit_exceeded_exception.LimitExceededException: <p>The request exceeded a service quota.</p>
capo_internetmonitor.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
capo_internetmonitor.errors.validation_exception.ValidationException: <p>Invalid request.</p>
capo_internetmonitor.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_internetmonitor.types.get_query_results_input.GetQueryResultsInput]",
) -> OperationResponse[
"capo_internetmonitor.types.get_query_results_output.GetQueryResultsOutput"
]:
import capo_internetmonitor._operations.internet_monitor20210603.get_query_results
output, http_response = (
capo_internetmonitor._operations.internet_monitor20210603.get_query_results.get_query_results(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetQueryResults")
)
input_: capo_internetmonitor.types.get_query_results_input.GetQueryResultsInput = {
"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 = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|