Starts a telemetry query within a session. Submits the provided query string for execution in the specified session. Use GetTelemetryQueryResults to poll for results and check query status.
Parameters:
-
query_string
(str)
–
The query string to execute.
-
session_id
(str)
–
The unique ID of the session.
Raises:
Examples:
Start a telemetry query
The following example submits a SQL query within a session and returns the query ID used to poll for results. Payloads are shown as JSON; on the wire they are CBOR-encoded.
>>> await client.start_telemetry_query(session_id='9f8c7d6e-5b4a-4c3d-9e2f-1a0b2c3d4e5f', query_string='SELECT `@timestamp`, `@message` FROM "logs.default" WHERE `@timestamp` BETWEEN NOW() - INTERVAL \'1 HOUR\' AND NOW() ORDER BY `@timestamp` DESC LIMIT 100')
Source code in docs_src/capo_cloudwatchomni/_services/async_cloud_watch_omni.py
| async def start_telemetry_query(
self,
query_string: str,
session_id: str,
*,
config_overrides: Optional[AsyncCloudWatchOmniClientConfig] = None,
) -> "capo_cloudwatchomni.types.start_telemetry_query_response.StartTelemetryQueryResponse":
r"""Starts a telemetry query within a session. Submits the provided query string for execution in the specified session. Use GetTelemetryQueryResults to poll for results and check query status.
Args:
query_string: The query string to execute.
session_id: The unique ID of the session.
Raises:
capo_cloudwatchomni.errors.access_denied_exception.AccessDeniedException: The caller is not authorized to perform this action.
capo_cloudwatchomni.errors.internal_server_exception.InternalServerException: An unexpected error occurred while processing the request.
capo_cloudwatchomni.errors.throttling_exception.ThrottlingException: The request was throttled due to exceeding the allowed request rate.
capo_cloudwatchomni.errors.validation_exception.ValidationException: A parameter is specified incorrectly.
capo_cloudwatchomni.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
Start a telemetry query
The following example submits a SQL query within a session and returns the query ID used to poll for results. Payloads are shown as JSON; on the wire they are CBOR-encoded.
>>> await client.start_telemetry_query(session_id='9f8c7d6e-5b4a-4c3d-9e2f-1a0b2c3d4e5f', query_string='SELECT `@timestamp`, `@message` FROM "logs.default" WHERE `@timestamp` BETWEEN NOW() - INTERVAL \'1 HOUR\' AND NOW() ORDER BY `@timestamp` DESC LIMIT 100')
"""
async def _handler(
req: "AsyncOperationRequest[capo_cloudwatchomni.types.start_telemetry_query_request.StartTelemetryQueryRequest]",
) -> AsyncOperationResponse[
"capo_cloudwatchomni.types.start_telemetry_query_response.StartTelemetryQueryResponse"
]:
import capo_cloudwatchomni._operations.cloud_watch_omni_frontend.start_telemetry_query
(
output,
http_response,
) = await capo_cloudwatchomni._operations.cloud_watch_omni_frontend.start_telemetry_query.async_start_telemetry_query(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("StartTelemetryQuery")
)
input_: capo_cloudwatchomni.types.start_telemetry_query_request.StartTelemetryQueryRequest = {
"query_string": query_string,
"session_id": session_id,
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|