Returns a list of insights in your Amazon Web Services account. You can specify which insights are returned by their start time, one or more statuses (ONGOING or CLOSED), one or more severities (LOW, MEDIUM, and HIGH), and type (REACTIVE or PROACTIVE).
Use the Filters parameter to specify status and severity search parameters. Use the Type parameter to specify REACTIVE or PROACTIVE in your search.
Parameters:
-
start_time_range
(StartTimeRange)
–
The start of the time range passed in. Returned insights occurred after this time.
-
filters
(Optional[SearchInsightsFilters], default:
None
)
–
A SearchInsightsFilters object that is used to set the severity and status filters on your insight search.
-
max_results
(Optional[SearchInsightsMaxResults], default:
None
)
–
The maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned nextToken value.
-
next_token
(Optional[UuidNextToken], default:
None
)
–
The pagination token to use to retrieve the next page of results for this operation. If this value is null, it retrieves the first page.
-
type
(InsightType)
–
The type of insights you are searching for (REACTIVE or PROACTIVE).
Raises:
-
AccessDeniedException
–
You don't have permissions to perform the requested operation. The user or role that is making the request must have at least one IAM permissions policy attached that grants the required permissions. For more information, see Access Management in the IAM User Guide.
-
InternalServerException
–
An internal failure in an Amazon service occurred.
-
ThrottlingException
–
The request was denied due to a request throttling.
-
ValidationException
–
Contains information about data passed in to a field during a request that is not valid.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_devops_guru/_services/async_dev_ops_guru.py
| async def search_insights(
self,
start_time_range: "capo_devops_guru.types.start_time_range.StartTimeRange",
type: "capo_devops_guru.types.insight_type.InsightType",
*,
config_overrides: Optional[AsyncDevOpsGuruClientConfig] = None,
filters: Optional[
"capo_devops_guru.types.search_insights_filters.SearchInsightsFilters"
] = None,
max_results: Optional[
"capo_devops_guru.types.search_insights_max_results.SearchInsightsMaxResults"
] = None,
next_token: Optional[
"capo_devops_guru.types.uuid_next_token.UuidNextToken"
] = None,
) -> "capo_devops_guru.types.search_insights_response.SearchInsightsResponse":
"""<p> Returns a list of insights in your Amazon Web Services account. You can specify which insights are returned by their start time, one or more statuses (<code>ONGOING</code> or <code>CLOSED</code>), one or more severities (<code>LOW</code>, <code>MEDIUM</code>, and <code>HIGH</code>), and type (<code>REACTIVE</code> or <code>PROACTIVE</code>). </p> <p> Use the <code>Filters</code> parameter to specify status and severity search parameters. Use the <code>Type</code> parameter to specify <code>REACTIVE</code> or <code>PROACTIVE</code> in your search. </p>
Args:
start_time_range: <p> The start of the time range passed in. Returned insights occurred after this time. </p>
filters: <p> A <code>SearchInsightsFilters</code> object that is used to set the severity and status filters on your insight search. </p>
max_results: <p>The maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned <code>nextToken</code> value.</p>
next_token: <p>The pagination token to use to retrieve the next page of results for this operation. If this value is null, it retrieves the first page.</p>
type: <p> The type of insights you are searching for (<code>REACTIVE</code> or <code>PROACTIVE</code>). </p>
Raises:
capo_devops_guru.errors.access_denied_exception.AccessDeniedException: <p> You don't have permissions to perform the requested operation. The user or role that is making the request must have at least one IAM permissions policy attached that grants the required permissions. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html">Access Management</a> in the <i>IAM User Guide</i>. </p>
capo_devops_guru.errors.internal_server_exception.InternalServerException: <p>An internal failure in an Amazon service occurred.</p>
capo_devops_guru.errors.throttling_exception.ThrottlingException: <p>The request was denied due to a request throttling.</p>
capo_devops_guru.errors.validation_exception.ValidationException: <p> Contains information about data passed in to a field during a request that is not valid. </p>
capo_devops_guru.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_devops_guru.types.search_insights_request.SearchInsightsRequest]",
) -> AsyncOperationResponse[
"capo_devops_guru.types.search_insights_response.SearchInsightsResponse"
]:
import capo_devops_guru._operations.capstone_control_plane_service.search_insights
(
output,
http_response,
) = await capo_devops_guru._operations.capstone_control_plane_service.search_insights.async_search_insights(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("SearchInsights")
)
input_: capo_devops_guru.types.search_insights_request.SearchInsightsRequest = {
"start_time_range": start_time_range,
"type": type,
}
if filters is not None:
input_["filters"] = filters
if max_results is not None:
input_["max_results"] = max_results
if next_token is not None:
input_["next_token"] = next_token
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|