Returns a list of the log groups that were analyzed during a single CloudWatch Logs Insights query. This can be useful for queries that use log group name prefixes or the filterIndex command, because the log groups are dynamically selected in these cases.
For more information about field indexes, see Create field indexes to improve query performance and reduce costs.
Parameters:
Raises:
Source code in docs_src/capo_cloudwatch_logs/_services/async_cloud_watch_logs.py
| async def list_log_groups_for_query(
self,
query_id: "capo_cloudwatch_logs.types.query_id.QueryId",
*,
config_overrides: Optional[AsyncCloudWatchLogsClientConfig] = None,
next_token: Optional["capo_cloudwatch_logs.types.next_token.NextToken"] = None,
max_results: Optional[
"capo_cloudwatch_logs.types.list_log_groups_for_query_max_results.ListLogGroupsForQueryMaxResults"
] = None,
) -> "capo_cloudwatch_logs.types.list_log_groups_for_query_response.ListLogGroupsForQueryResponse":
"""<p>Returns a list of the log groups that were analyzed during a single CloudWatch Logs Insights query. This can be useful for queries that use log group name prefixes or the <code>filterIndex</code> command, because the log groups are dynamically selected in these cases.</p> <p>For more information about field indexes, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatchLogs-Field-Indexing.html">Create field indexes to improve query performance and reduce costs</a>.</p>
Args:
query_id: <p>The ID of the query to use. This query ID is from the response to your <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_StartQuery.html">StartQuery</a> operation.</p>
max_results: <p>Limits the number of returned log groups to the specified number.</p>
Raises:
capo_cloudwatch_logs.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient permissions to perform this action.</p>
capo_cloudwatch_logs.errors.invalid_parameter_exception.InvalidParameterException: <p>A parameter is specified incorrectly.</p>
capo_cloudwatch_logs.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
capo_cloudwatch_logs.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service cannot complete the request.</p>
capo_cloudwatch_logs.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_cloudwatch_logs.types.list_log_groups_for_query_request.ListLogGroupsForQueryRequest]",
) -> AsyncOperationResponse[
"capo_cloudwatch_logs.types.list_log_groups_for_query_response.ListLogGroupsForQueryResponse"
]:
import capo_cloudwatch_logs._operations.logs_20140328.list_log_groups_for_query
(
output,
http_response,
) = await capo_cloudwatch_logs._operations.logs_20140328.list_log_groups_for_query.async_list_log_groups_for_query(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("ListLogGroupsForQuery")
)
input_: capo_cloudwatch_logs.types.list_log_groups_for_query_request.ListLogGroupsForQueryRequest = {
"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
|