Retrieves a list of the log anomaly detectors in the account.
Parameters:
-
filter_log_group_arn
(Optional[LogGroupArn], default:
None
)
–
Use this to optionally filter the results to only include anomaly detectors that are associated with the specified log group.
-
limit
(Optional[ListLogAnomalyDetectorsLimit], default:
None
)
–
The maximum number of items to return. If you don't specify a value, the default maximum value of 50 items is used.
Raises:
Source code in docs_src/capo_cloudwatch_logs/_services/cloud_watch_logs.py
| def list_log_anomaly_detectors(
self,
*,
config_overrides: Optional[CloudWatchLogsClientConfig] = None,
filter_log_group_arn: Optional[
"capo_cloudwatch_logs.types.log_group_arn.LogGroupArn"
] = None,
limit: Optional[
"capo_cloudwatch_logs.types.list_log_anomaly_detectors_limit.ListLogAnomalyDetectorsLimit"
] = None,
next_token: Optional["capo_cloudwatch_logs.types.next_token.NextToken"] = None,
) -> "capo_cloudwatch_logs.types.list_log_anomaly_detectors_response.ListLogAnomalyDetectorsResponse":
"""<p>Retrieves a list of the log anomaly detectors in the account.</p>
Args:
filter_log_group_arn: <p>Use this to optionally filter the results to only include anomaly detectors that are associated with the specified log group.</p>
limit: <p>The maximum number of items to return. If you don't specify a value, the default maximum value of 50 items is used.</p>
Raises:
capo_cloudwatch_logs.errors.invalid_parameter_exception.InvalidParameterException: <p>A parameter is specified incorrectly.</p>
capo_cloudwatch_logs.errors.operation_aborted_exception.OperationAbortedException: <p>Multiple concurrent requests to update the same resource were in conflict.</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.
"""
def _handler(
req: "OperationRequest[capo_cloudwatch_logs.types.list_log_anomaly_detectors_request.ListLogAnomalyDetectorsRequest]",
) -> OperationResponse[
"capo_cloudwatch_logs.types.list_log_anomaly_detectors_response.ListLogAnomalyDetectorsResponse"
]:
import capo_cloudwatch_logs._operations.logs_20140328.list_log_anomaly_detectors
output, http_response = (
capo_cloudwatch_logs._operations.logs_20140328.list_log_anomaly_detectors.list_log_anomaly_detectors(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("ListLogAnomalyDetectors")
)
input_: capo_cloudwatch_logs.types.list_log_anomaly_detectors_request.ListLogAnomalyDetectorsRequest = {}
if filter_log_group_arn is not None:
input_["filter_log_group_arn"] = filter_log_group_arn
if limit is not None:
input_["limit"] = limit
if next_token is not None:
input_["next_token"] = next_token
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|